pg.ddx.io  pgsql-sql@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Sean Davis <sdavis2@mail.nih.gov>
To: Edmund Bacon <ebacon@onesystem.com>
Cc: PostgreSQL SQL <pgsql-sql@postgresql.org>
Subject: Re: Self-referencing table question
Date: Thu, 24 Mar 2005 14:01:13 -0500
Message-ID: <62cd9fffe536b0665a1da78478c4ec20@mail.nih.gov> (raw)
In-Reply-To: <424302D1.7000602@onesystem.com>
References: <0af8c6d3baaf3d4a6d918df294019507@mail.nih.gov>
	<7e154914b76fb1a7c55912b621400860@mail.nih.gov>
	<4240874E.2080301@archonet.com>
	<4242E732.3050600@onesystem.com>
	<1303f92d183bfd2ff7c522d4ad5afde8@mail.nih.gov>
	<424302D1.7000602@onesystem.com>


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




view thread (11+ messages)  latest in thread

Message-ID: <62cd9fffe536b0665a1da78478c4ec20@mail.nih.gov>
Permalink:  ../62cd9fffe536b0665a1da78478c4ec20@mail.nih.gov/
Also on:    postgresql.org/message-id/62cd9fffe536b0665a1da78478c4ec20@mail.nih.gov

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: pgsql-sql@postgresql.org
  Cc: sdavis2@mail.nih.gov, ebacon@onesystem.com
  Subject: Re: Self-referencing table question
  In-Reply-To: <62cd9fffe536b0665a1da78478c4ec20@mail.nih.gov>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox