pg.ddx.io  pgsql-performance@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Tom Lane <tgl@sss.pgh.pa.us>
To: Oleg Lebedev <oleg.lebedev@waterford.org>
Cc: Jenny Zhang <jenny@osdl.org>
Cc: pgsql-performance@postgresql.org <pgsql-performance@postgresql.org>
Subject: Re: TPC-R benchmarks
Date: Fri, 26 Sep 2003 00:28:54 -0400
Message-ID: <8486.1064550534@sss.pgh.pa.us> (raw)
In-Reply-To: <993DBE5B4D02194382EC8DF8554A52731D75DC@postoffice.waterford.org>
References: <993DBE5B4D02194382EC8DF8554A52731D75DC@postoffice.waterford.org>

Oleg Lebedev <oleg.lebedev@waterford.org> writes:
> Seems like in your case postgres uses an i_l_partkey index on lineitem
> table. I have a foreign key constraint defined between the lineitem and
> part table, but didn't create an special indexes. Here is my query plan:

The planner is obviously unhappy with this plan (note the large cost
numbers), but it can't find a way to do better.  An index on
lineitem.l_partkey would help, I think.

The whole query seems like it's written in a very inefficient fashion;
couldn't the estimation of '0.2 * avg(l_quantity)' be amortized across
multiple join rows?  But I dunno whether the TPC rules allow for
significant manual rewriting of the given query.

			regards, tom lane



view thread (43+ messages)  latest in thread

Message-ID: <8486.1064550534@sss.pgh.pa.us>
Permalink:  ../8486.1064550534@sss.pgh.pa.us/
Also on:    postgresql.org/message-id/8486.1064550534@sss.pgh.pa.us

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: pgsql-performance@postgresql.org
  Cc: tgl@sss.pgh.pa.us, oleg.lebedev@waterford.org, jenny@osdl.org
  Subject: Re: TPC-R benchmarks
  In-Reply-To: <8486.1064550534@sss.pgh.pa.us>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox