Skip site navigation (1) Skip section navigation (2)

BUG #5226: Limit operator slows down

From: "aftab" <akhangd(at)hotmail(dot)co(dot)uk>
To: pgsql-bugs(at)postgresql(dot)org
Subject: BUG #5226: Limit operator slows down
Date: 2009-12-02 14:35:21
Message-ID: 200912021435.nB2EZLa9095635@wwwmaster.postgresql.org (view raw or flat)
Thread:
Lists: pgsql-bugs
The following bug has been logged online:

Bug reference:      5226
Logged by:          aftab
Email address:      akhangd(at)hotmail(dot)co(dot)uk
PostgreSQL version: 8.3.8
Operating system:   Centos 5
Description:        Limit operator slows down
Details: 

S1="SELECT *
FROM position WHERE 
position.POSITION_STATE_ID=2 AND 
position.TARGET_ID=18
ORDER BY position.ID DESC 
";
S2="SELECT *
FROM position WHERE 
position.POSITION_STATE_ID=2 AND 
position.TARGET_ID=18
ORDER BY position.ID DESC 
LIMIT 1
";

S1 takes 0.16ms compared to S2 which takes 5 secs. Both S1 and S2 are same
except "LIMIT 1 " is added to S2.

Responses

pgsql-bugs by date

Next:From: Sriram GopalanDate: 2009-12-02 15:51:46
Subject: Re: BUG #5224: After upgrading from vista to windows 7, postgres services are missing
Previous:From: Kurt wagnerDate: 2009-12-02 12:45:15
Subject: BUG #5225: create table: cast necessary for constant??

Privacy Policy | About PostgreSQL
Copyright © 1996-2014 The PostgreSQL Global Development Group