Re: Ad Hoc Indexes

From: Hans-Juergen Schoenig <postgres(at)cybertec(dot)at>
To: Peter Eisentraut <peter_e(at)gmx(dot)net>
Cc: pgsql-hackers(at)postgresql(dot)org, Justin <justin(at)emproshunts(dot)com>
Subject: Re: Ad Hoc Indexes
Date: 2008-02-18 20:16:38
Message-ID: 16AB0F44-B51C-4CB7-9748-EBFDB416847A@cybertec.at
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: 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

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Tom Lane 2008-02-18 20:18:17 Re: Ad Hoc Indexes
Previous Message Tom Lane 2008-02-18 20:13:15 Re: IDENTITY/GENERATED patch