Re: Self-referencing table question

From: Sean Davis <sdavis2(at)mail(dot)nih(dot)gov>
To: Edmund Bacon <ebacon(at)onesystem(dot)com>
Cc: PostgreSQL SQL <pgsql-sql(at)postgresql(dot)org>
Subject: Re: Self-referencing table question
Date: 2005-03-24 19:01:13
Message-ID: 62cd9fffe536b0665a1da78478c4ec20@mail.nih.gov
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-sql


On Mar 24, 2005, at 1:11 PM, Edmund Bacon wrote:

> Sean Davis wrote:
>
>> Thanks. I thought about that a bit and it seems like it is highly
>> likely to be expensive for a single query (though I should probably
>> try it at some point). If I do find myself reformatting results
>> after response to user input (i.e., reusing the query), though, then
>> your solution is likely to be very useful.
>>
>
>
> Note that the subselect version takes about 10 times as long as the
> temptable version, and does not seem to be dependent on what data
> might be cached.
>>>

Nice. Thanks for doing my work for me! I guess I will have to think
about it more seriously.

It could be a slight bit complicated because my code is running under
mod_perl, so connections are cached. As I understand it, the temp
table will stick around, so I will have to be careful to explicitly
drop it if I don't want it to persist? Also each table will need a
unique name (I have a session_id I can use), as it is possible that
multiple temp tables will exist and be visible to each other?

Thanks again,
Sean

In response to

Responses

Browse pgsql-sql by date

  From Date Subject
Next Message Edmund Bacon 2005-03-24 19:37:16 Re: Self-referencing table question
Previous Message Moran.Michael 2005-03-24 18:59:08 Re: Funtions + plpgsql + contrib/pgcrypto = ??