| From: | "Peter Krauss" <krauss(at)i-node(dot)com(dot)br> |
|---|---|
| To: | pgsql-bugs(at)postgresql(dot)org |
| Subject: | BUG #2381: LIMIT 1 very very lazy than without |
| Date: | 2006-04-06 22:50:49 |
| Message-ID: | 200604062250.k36MonFr099690@wwwmaster.postgresql.org |
| Views: | Whole Thread | Raw Message | Download mbox | Resend email |
| Thread: | |
| Lists: | pgsql-bugs |
The following bug has been logged online:
Bug reference: 2381
Logged by: Peter Krauss
Email address: krauss(at)i-node(dot)com(dot)br
PostgreSQL version: 7.4
Operating system: Linux
Description: LIMIT 1 very very lazy than without
Details:
The single query (on psql) is fary fast
(less than 1 sec)
SELECT a,b,c,d FROM products_view WHERE
sku='0-123-0-0-6024-20'
OR lower(codfornecedor)=lower('0-123-0-0-6024-20')
OR lower(eanfor)=lower('0-123-0-0-6024-20')
OR lower(refprodfornecedor)=lower('0-123-0-0-6024-20');
-- ~0.1 second
BUT, IF I ADD a "LIMIT 1", it consumes 2 minutes!
SELECT a,b,c,d FROM products_view WHERE
sku='0-123-0-0-6024-20'
OR lower(codfornecedor)=lower('0-123-0-0-6024-20')
OR lower(eanfor)=lower('0-123-0-0-6024-20')
OR lower(refprodfornecedor)=lower('0-123-0-0-6024-20')
LIMIT 1;
-- ~ 2 minutes !!
| From | Date | Subject | |
|---|---|---|---|
| Next Message | Philip Warner | 2006-04-07 01:56:37 | Re: BUG #2379: Duplicate pkeys in table |
| Previous Message | Stephan Szabo | 2006-04-06 21:56:25 | Re: BUG #2377: pg_constraint didnt't updated when table |