Re: Join question

From: "Williams, Travis L, NEO" <tlw(at)att(dot)com>
To: "Jeffrey Melloy" <jmelloy(at)visualdistortion(dot)org>
Cc: "Thomas A(dot) Lowery" <tlowery(at)stlowery(dot)net>, <pgsql-general(at)postgresql(dot)org>
Subject: Re: Join question
Date: 2003-08-29 16:54:02
Message-ID: AB815D267EC31A4693CC24D234F8291605A36AC0@ACCLUST02EVS1.ugd.att.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

about 5% of b are null.. any idea on how to word a query like what I'm
looking for? I have no idea in SQL how to use the results of one select
in another (I usually just do all of it in perl).

Travis

-----Original Message-----
From: Jeffrey Melloy [mailto:jmelloy(at)visualdistortion(dot)org]
Sent: Friday, August 29, 2003 12:44 AM
To: Williams, Travis L, NEO
Cc: Thomas A. Lowery; pgsql-general(at)postgresql(dot)org
Subject: Re: [GENERAL] Join question

On Friday, August 29, 2003, at 12:36 AM, Williams, Travis L, NEO wrote:

> Performace wise would I be better off just doing 2 query's.. i.e.
> select
> a,b from table1.. then in perl I can check if b is not null and if is
> isn't then I do a second query?
>
> Travis
>
I would say it depends on the table distribution (% of b that are null,
etc). At that point, you're just going to have to experiment, I think,
and see what works best for you. My gut says that even including a
subselect, it will be faster than checking in perl and issuing another
query. But I have no idea, and the proper solution might change
drastically based on your data.

Jeff

Browse pgsql-general by date

  From Date Subject
Next Message Andrew Sullivan 2003-08-29 17:05:45 Re: erserver 1.2 problem
Previous Message Andrew Sullivan 2003-08-29 16:40:42 Re: Database Replication