Re: query taking too long - Mailing list pgsql-general

From Tom Lane
Subject Re: query taking too long
Date
Msg-id 24734.1048884492@sss.pgh.pa.us
Whole thread Raw
In response to query taking too long  ("Johnson, Shaunn" <SJohnson6@bcbsm.com>)
List pgsql-general
"Johnson, Shaunn" <SJohnson6@bcbsm.com> writes:
> <P><FONT SIZE=3D2>How can I modify this to be more efficient?</FONT>

[Please don't post HTML...]

I think the first question to ask is whether it's even correct.  It
looks to me like the EXISTS doesn't depend on the outer query, so
it's effectively a constant, and assuming that the constant is TRUE,
*every* row of db2_pos_fac_rev_02 will be returned.

Also, have you done VACUUM ANALYZE lately?  The explain estimates
seem suspiciously low.

            regards, tom lane


pgsql-general by date:

Previous
From: "Johnson, Shaunn"
Date:
Subject: query taking too long
Next
From: Guy Fraser
Date:
Subject: Re: Realistic upper bounds on DB size