Re: Ad Hoc Indexes

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Justin <justin(at)emproshunts(dot)com>
Cc: pgsql-hackers(at)postgresql(dot)org
Subject: Re: Ad Hoc Indexes
Date: 2008-02-18 21:28:25
Message-ID: 1552.1203370105@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Justin <justin(at)emproshunts(dot)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

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Stephan Szabo 2008-02-18 21:37:08 Re: [HACKERS] deadlock with truncate and foreing keys
Previous Message Justin 2008-02-18 21:08:24 Re: Ad Hoc Indexes