Re: TPC-R benchmarks - Mailing list pgsql-performance

From Oleg Lebedev
Subject Re: TPC-R benchmarks
Date
Msg-id 993DBE5B4D02194382EC8DF8554A52731D7604@postoffice.waterford.org
Whole thread Raw
In response to TPC-R benchmarks  (Oleg Lebedev <oleg.lebedev@waterford.org>)
Responses Re: TPC-R benchmarks
Re: TPC-R benchmarks
List pgsql-performance
I continue struggling with the TPC-R benchmarks and wonder if anyone
could help me optimize the query below. ANALYZE statistics indicate that
the query should run relatively fast, but it takes hours to complete. I
attached the query plan to this posting.
Thanks.

select
    nation,
    o_year,
    sum(amount) as sum_profit
from
    (
        select
            n_name as nation,
            extract(year from o_orderdate) as o_year,
            l_extendedprice * (1 - l_discount) -
ps_supplycost * l_quantity as amount
        from
            part,
            supplier,
            lineitem,
            partsupp,
            orders,
            nation
        where
            s_suppkey = l_suppkey
            and ps_suppkey = l_suppkey
            and ps_partkey = l_partkey
            and p_partkey = l_partkey
            and o_orderkey = l_orderkey
            and s_nationkey = n_nationkey
            and p_name like '%aquamarine%'
    ) as profit
group by
    nation,
    o_year
order by
    nation,
    o_year desc;

*************************************

This e-mail may contain privileged or confidential material intended for the named recipient only.
If you are not the named recipient, delete this message and all attachments.
Unauthorized reviewing, copying, printing, disclosing, or otherwise using information in this e-mail is prohibited.
We reserve the right to monitor e-mail sent through our network.

*************************************

Attachment

pgsql-performance by date:

Previous
From: David Griffiths
Date:
Subject: Tuning/performance issue....
Next
From: Tom Lane
Date:
Subject: Re: Tuning/performance issue...