Re: Optimisation deficiency: currval('seq')-->seq scan, constant-->index scan - Mailing list pgsql-hackers

From Tom Lane
Subject Re: Optimisation deficiency: currval('seq')-->seq scan, constant-->index scan
Date
Msg-id 20970.967089395@sss.pgh.pa.us
Whole thread Raw
In response to Re: Optimisation deficiency: currval('seq')-->seq scan, constant-->index scan  (Tiago Antão <tra@fct.unl.pt>)
List pgsql-hackers
Tiago Antão <tra@fct.unl.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


pgsql-hackers by date:

Previous
From: Vince Vielhaber
Date:
Subject: Re: How do pronounce PostgreSQL - the final word.
Next
From: Tom Lane
Date:
Subject: Re: [7.0.2] problems with spinlock under FreeBSD?