pg.ddx.io  pgsql-performance@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Tom Lane <tgl@sss.pgh.pa.us>
To: Fabio Panizzutti <panizzutti@interlogica.net>
Cc: 'Shridhar Daithankar' <shridhar@frodo.hserus.net>
Cc: pgsql-performance@postgresql.org
Subject: Re: R: Query plan on identical tables differs . Why ?
Date: Thu, 13 May 2004 11:01:00 -0400
Message-ID: <8904.1084460460@sss.pgh.pa.us> (raw)
In-Reply-To: <006301c438f3$6ca33460$3c02020a@ufficio>
References: <006301c438f3$6ca33460$3c02020a@ufficio>

"Fabio Panizzutti" <panizzutti@interlogica.net> writes:
> I don't understand why the planner chose a different query plan on
> identical tables with same indexes . 

Different data statistics; not to mention different table sizes
(the cost equations are not linear).

Have you ANALYZEd (or VACUUM ANALYZEd) both tables recently?

If the stats are up to date but still not doing the right thing,
you might try increasing the statistics target for the larger
table's tag_id column.  See ALTER TABLE SET STATISTICS.

			regards, tom lane



view thread (3+ messages)  latest in thread

Message-ID: <8904.1084460460@sss.pgh.pa.us>
Permalink:  ../8904.1084460460@sss.pgh.pa.us/
Also on:    postgresql.org/message-id/8904.1084460460@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, panizzutti@interlogica.net, shridhar@frodo.hserus.net
  Subject: Re: R: Query plan on identical tables differs . Why ?
  In-Reply-To: <8904.1084460460@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