Re: Optimisation deficiency: currval('seq')-->seq scan, constant-->index scan

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Tiago Antão <tra(at)fct(dot)unl(dot)pt>
Cc: Jules Bean <jules(at)jellybean(dot)co(dot)uk>, pgsql-hackers(at)postgresql(dot)org
Subject: Re: Optimisation deficiency: currval('seq')-->seq scan, constant-->index scan
Date: 2000-08-24 03:56:35
Message-ID: 20970.967089395@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

=?iso-8859-1?Q?Tiago_Ant=E3o?= <tra(at)fct(dot)unl(dot)pt> writes:
> One other idea would be to only have better statistics for special
> attributes requested by the user... something like "analyze special
> table(column)".

This might actually fall out "for free" from the cheapest way of
implementing the stats. We've talked before about scanning btree
indexes directly to obtain data values in sorted order, which makes
it very easy to find the most common values. If you do that, you
get good stats for exactly those columns that the user has created
indexes on. A tad indirect but I bet it'd be effective...

regards, tom lane

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Tom Lane 2000-08-24 04:05:08 Re: [7.0.2] problems with spinlock under FreeBSD?
Previous Message Vince Vielhaber 2000-08-23 22:26:22 Re: How do pronounce PostgreSQL - the final word.