Re: temporary indexes?

From: Jeff Janes <jeff(dot)janes(at)gmail(dot)com>
To: Adrian Klaver <adrian(dot)klaver(at)aklaver(dot)com>
Cc: Jonathan Vanasco <postgres(at)2xlp(dot)com>, PostgreSQL mailing lists <pgsql-general(at)postgresql(dot)org>
Subject: Re: temporary indexes?
Date: 2015-10-21 18:59:47
Message-ID: CAMkU=1wVNOV8nJbSkTSf0QBavDRrkid30JA_eyskH-MRbkNvWA@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

On Wed, Oct 21, 2015 at 11:50 AM, Adrian Klaver <adrian(dot)klaver(at)aklaver(dot)com>
wrote:

> On 10/21/2015 11:43 AM, Jonathan Vanasco wrote:
>
>> I couldn't find any mention of this on the archives...
>>
>> Have the project maintainers ever considered extending CREATE INDEX to
>> support "temporary" indexes like CREATE TEMPORARY TABLE?
>>
>> When creating temporary tables for analytics/reporting, I've noticed that
>> I often need to create (then drop) indexes on regular tables. Temporary
>> indexes seemed like a natural fit here, so i was wondering if there was any
>> reason why they're not supported (other than no one wanted it!)
>>
>
> Something like this?:
>
> aklaver(at)test=> create temporary table temp_test(id int, fld_1 varchar);
> CREATE TABLE
>
> aklaver(at)test=> create index temp_idx on temp_test(fld_1);
> CREATE INDEX
>

I think he means more like:

create temporary table temp_test(id int, fld_1 varchar);
create temporary index on permanent_table (fld_1);

select something from temp_test join permanent_table using (fld_1) where
a=b;
select something_else from temp_test join permanent_table using (fld_1)
where c=d;

Cheers,

Jeff

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Scott Mead 2015-10-21 19:02:49 Re: trouble downloading postgres 9.4 for RHEL 6.x
Previous Message anj patnaik 2015-10-21 18:58:02 Re: trouble downloading postgres 9.4 for RHEL 6.x