Re: R: Query plan on identical tables differs . Why ?

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: "Fabio Panizzutti" <panizzutti(at)interlogica(dot)net>
Cc: "'Shridhar Daithankar'" <shridhar(at)frodo(dot)hserus(dot)net>, pgsql-performance(at)postgresql(dot)org
Subject: Re: R: Query plan on identical tables differs . Why ?
Date: 2004-05-13 15:01:00
Message-ID: 8904.1084460460@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-performance

"Fabio Panizzutti" <panizzutti(at)interlogica(dot)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

In response to

Responses

Browse pgsql-performance by date

  From Date Subject
Next Message Stephan Szabo 2004-05-13 15:16:34 Re: R: Query plan on identical tables differs . Why ?
Previous Message Fabio Panizzutti 2004-05-13 14:06:01 R: Query plan on identical tables differs . Why ?