Re: [SQL] sub-query optimization

2003-02-14 Thread Brad Hilton
On Fri, 2003-02-14 at 04:59, Tomasz Myrta wrote: > Brad Hilton wrote: > > > select * from articles where exists > > (select 1 from article_categories, categories, category_map > >where > >article_categories.article_id = articles.id and > >categories.restrict_views = FALSE and > >

Re: [SQL] sub-query optimization

2003-02-14 Thread Brad Hilton
On Fri, 2003-02-14 at 14:08, Tom Lane wrote: > Brad Hilton <[EMAIL PROTECTED]> writes: > > ... If I modify the query slightly: > > > > > select 1 from article_categories > > --> > > select 1 from articles, article_categories > > - > > > the query takes 98 msec. > > Yeah, becau

Re: [SQL] postmaster -i & establishes three connections why?

2003-02-14 Thread Robert Treat
Hi, > > I've just upgraded my cygwin to 1.3.20-1 and postgresql to 7.3.2 > > And I found that when run > > postmaster -i & > > There are three connections being established and why is that? > > Administrator@DemoServer ~ > $ LOG: database system was shut down at 2003-02-13 17:33:26 EST

Re: [SQL] Timezone conversion

2003-02-14 Thread Tom Lane
Stephan Szabo <[EMAIL PROTECTED]> writes: > On Thu, 13 Feb 2003, Jeff Boes wrote: >> Is there a straightforward way to change the display of a time to another >> timezone? For example, my server's environment is EST (-0500); I want to >> convert timestamps for display in PST (-0800). > I think yo

Re: [SQL] sub-query optimization

2003-02-14 Thread Stephan Szabo
On 14 Feb 2003, Brad Hilton wrote: > I am hoping someone can help explain why modifying the following query > can effect such a huge change in speed. The query is: > > select * from articles > where exists >( select 1 from article_categories > where > articl

Re: [SQL] PL/PGSQL EDITOR

2003-02-14 Thread Tambet Matiisen
I use Editplus (http://www.editplus.com/) with PosgreSQL syntax highlighting (ftp://ftp.editplus.com/files/postgre.zip). I also define psql as external tool in Editplus and use shortcut (Ctrl + 1) to send file to server. Tambet - Original Message - From: "Eduardo" <[EMAIL PROTECTED]> To

[SQL] Timezone conversion

2003-02-14 Thread Jeff Boes
Is there a straightforward way to change the display of a time to another timezone? For example, my server's environment is EST (-0500); I want to convert timestamps for display in PST (-0800). What I've been doing is to use a Pl/Pgsql function to subtract the current timezone-offset and add in t

Re: [SQL] rownum

2003-02-14 Thread Tom Lane
Joe Conway <[EMAIL PROTECTED]> writes: > I've played with this a bit in the past, and concluded that the best way > to do it (if in fact you agree it should be done at all), would be to > add a rownum pseudo column as the results are projected from the backend > to the frontend. I think this wou

Re: [SQL] Table Pivot

2003-02-14 Thread Gary Stainburn
On Thursday 13 Feb 2003 10:48 am, V. Cekvenich wrote: > How do you do a table Pivot in PostgreSQL? Hi, I've noticed that you've posted this twice now with no response. I can't help you because I don't know what you mean by doing a 'table pivot', but maybe if you describe what you're trying to