Re: query does not return after increasing range in 'between' clause

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Dennis <dennisr(at)visi(dot)com>
Cc: "pgsql-general(at)postgresql(dot)org" <pgsql-general(at)postgresql(dot)org>
Subject: Re: query does not return after increasing range in 'between' clause
Date: 2014-08-27 19:00:21
Message-ID: 3056.1409166021@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

Dennis <dennisr(at)visi(dot)com> writes:
> Hi, I am having bad luck with a query that should return zero rows but actually never returns (completes execution.)

Seems like you need a multicolumn index on t_week_f, and maybe also on
nb_products, so that the conditions shown as "filters" here could be
applied as index conditions instead.

I wonder also if your statistics are up to date --- are the rowcount
estimates shown in EXPLAIN reasonably sane?

regards, tom lane

In response to

Browse pgsql-general by date

  From Date Subject
Next Message John R Pierce 2014-08-27 19:15:44 Re: Deletion
Previous Message Ramesh T 2014-08-27 18:59:03 Re: Deletion