BUG #3824: Query hangs when result set empty using sort and limit

From: "Gregor Roessle" <g(dot)roessle(at)osram(dot)de>
To: pgsql-bugs(at)postgresql(dot)org
Subject: BUG #3824: Query hangs when result set empty using sort and limit
Date: 2007-12-18 15:46:38
Message-ID: 200712181546.lBIFkcCK069641@wwwmaster.postgresql.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-bugs


The following bug has been logged online:

Bug reference: 3824
Logged by: Gregor Roessle
Email address: g(dot)roessle(at)osram(dot)de
PostgreSQL version: 8.2.5
Operating system: Linux - Kernel 2.4.33
Description: Query hangs when result set empty using sort and limit
Details:

The Server hangs when executing a query like this:

select * from messwerte where pknr = 28315178 and isproducing = 't' order by
timestamp desc limit 1;

leaving out the "order by" and "limit" the result set is empty and returned
in 32ms from the remote installed server (i.e. very fast).

Adding the "order by" causes no trouble, also does "limit". But if i add
_both_ - "limit" and "order by" as shown above the query hangs.

I personally consider this a bug.
But maybe my query is not sophisticated enough...

Responses

Browse pgsql-bugs by date

  From Date Subject
Next Message Tom Lane 2007-12-18 16:03:27 Re: BUG #3824: Query hangs when result set empty using sort and limit
Previous Message Josh St.Onge 2007-12-18 10:22:42 Error