Dennis <dennisr@xxxxxxxx> 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 -- Sent via pgsql-general mailing list (pgsql-general@xxxxxxxxxxxxxx) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-general