Re: Ad Hoc Indexes - Mailing list pgsql-hackers

From Hans-Juergen Schoenig
Subject Re: Ad Hoc Indexes
Date
Msg-id 16AB0F44-B51C-4CB7-9748-EBFDB416847A@cybertec.at
Whole thread Raw
In response to Re: Ad Hoc Indexes  (Peter Eisentraut <peter_e@gmx.net>)
Responses Re: Ad Hoc Indexes  (Peter Eisentraut <peter_e@gmx.net>)
List pgsql-hackers

On Feb 18, 2008, at 9:09 PM, Peter Eisentraut wrote:

Justin wrote:
Now for my question It does not appear PostgreSQL does not have an Ad
Hoc Indexes ability where the Query planner will create an in memory
index based on the Select, Update, Insert or Delete commands.

How is that supposed to work?  In order to create an index you would need to 
visit all the rows in the table.  If you do that, you could just as well 
answer the query off a sequential scan.



this is not quite true.
this kind of indexing makes sense if you visit the same data over and over again. WITH-queries would be an example for that and self joins could benefit from the this feature too.

the question however is: why not create "normal indexes" straight away?
i am not sure if the benefit of ad-hoc indexes justify additional complexity in the code ...

best regards,

hans


--
Cybertec Schönig & Schönig GmbH
PostgreSQL Solutions and Support
Gröhrmühlgasse 26, 2700 Wiener Neustadt
Tel: +43/1/205 10 35 / 340
www.postgresql.at, www.cybertec.at


pgsql-hackers by date:

Previous
From: Tom Lane
Date:
Subject: Re: IDENTITY/GENERATED patch
Next
From: Tom Lane
Date:
Subject: Re: Ad Hoc Indexes