Skip site navigation (1) Skip section navigation (2)

Re: Query tuning

From: "Scott Marlowe" <scott(dot)marlowe(at)gmail(dot)com>
To: kapil(dot)munish(at)wipro(dot)com
Cc: pgsql-sql(at)postgresql(dot)org
Subject: Re: Query tuning
Date: 2008-05-16 15:21:38
Message-ID: dcc563d10805160821p22e01297ia85bf6317c4a6c2b@mail.gmail.com (view raw or flat)
Thread:
Lists: pgsql-sql
On Thu, May 15, 2008 at 12:00 AM,  <kapil(dot)munish(at)wipro(dot)com> wrote:
> Hi,
>
> select count(distinct(j.JOBID)) as jobCount
> from  JOB_TYPE_FIRST a, JOB_TYPE_SECOND b, JOB_ALLOCATION_WORKLIST j
> where (( a.JOBID = j.JOBID)
> and (a.BOOK_ID = :bookId))
> or ((b.JOBID = j.JOBID)
> and (b.BOOK_ID = :bookId));

Have you tried joining a with j and b with j separately, and then
doing a union on those two sets?

In response to

Responses

pgsql-sql by date

Next:From: Simon RiggsDate: 2008-05-16 16:13:09
Subject: Re: Query tuning
Previous:From: A. KretschmerDate: 2008-05-16 14:27:09
Subject: Re: Find all instances of a column in the entire database.

Privacy Policy | About PostgreSQL
Copyright © 1996-2014 The PostgreSQL Global Development Group