Re: Problem with planner

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: depesz(at)depesz(dot)com
Cc: pgsql-general(at)postgresql(dot)org
Subject: Re: Problem with planner
Date: 2011-08-08 16:51:40
Message-ID: 27740.1312822300@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

hubert depesz lubaczewski <depesz(at)depesz(dot)com> writes:
> and we have a query:
> select count(*) from objects where state='active'::text and ending_tsz <= ( select now() - '1 day'::interval );

Try getting rid of the sub-select. There might have been a reason to do
it like that ten years ago, but these days it's a guaranteed
pessimization.

regards, tom lane

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message hubert depesz lubaczewski 2011-08-08 16:53:17 Re: Problem with planner
Previous Message hubert depesz lubaczewski 2011-08-08 15:53:18 Problem with planner