Re: Ad Hoc Indexes - Mailing list pgsql-hackers

From Tom Lane
Subject Re: Ad Hoc Indexes
Date
Msg-id 1552.1203370105@sss.pgh.pa.us
Whole thread Raw
In response to Re: Ad Hoc Indexes  (Justin <justin@emproshunts.com>)
Responses Re: Ad Hoc Indexes
List pgsql-hackers
Justin <justin@emproshunts.com> writes:
> The idea of ad hoc indexes is speed up loop scans  To prove my idea i 
> created a sql file in PGAdmin that creates the indexes on the fly then 
> runs the query then drops the indexs.

>  without the indexes it takes 18 to 19 seconds to run the query.

> To create the index and do the query takes 400 milliseconds.

The example you show doesn't convince me of much of anything, because
the estimated rowcounts are so far off.  I think you're basically
dealing with an estimation failure and it's pure luck that the extra
index fixes it.
        regards, tom lane


pgsql-hackers by date:

Previous
From: Justin
Date:
Subject: Re: Ad Hoc Indexes
Next
From: Stephan Szabo
Date:
Subject: Re: [GENERAL] deadlock with truncate and foreing keys