The following bug has been logged online:

Bug reference:      1393
Logged by:          Fahad
Email address:      [EMAIL PROTECTED]
PostgreSQL version: 8.0.0rc2
Operating system:   Linux
Description:        Adding 'LIMIT 1' to the query halts forever if no data
present
Details: 

Hi,

In an empty table, if I do this:

"SELECT some_field WHERE some_field = 45 ORDER BY time";

This returns instantly with no results. However, doing the following takes
forever to return:

"SELECT some_field WHERE some_field = 45 ORDER BY time LIMIT 1";

It's a pain because my application is pretty generic and does not know
beforehand whether 'some_field' with ID 45 exists or not OR whether the
table has been wiped out clean. Why does it take so long for this query to
return?


Fahad

---------------------------(end of broadcast)---------------------------
TIP 8: explain analyze is your friend

Reply via email to