Doing the following query:
explain analyze SELECT * FROM my.tablename WHERE node = '1234567890'
AND date BETWEEN '2005-03-27' AND NOW() ORDER BY id DESC
ORDER BY node,id is forcing the planner to use the right index.
Thanks,
Poul
---(end of broadcast)---
Poul Møller Hansen wrote:
Doing the following query:
explain analyze SELECT * FROM my.tablename WHERE node = '1234567890' AND
date BETWEEN '2005-03-27' AND NOW() ORDER BY id DESC
takes 1,3 sec. with this result:
Sort (cost=52971.52..53033.26 rows=24693 width=93) (actual
time=1141.002..1252.9
Doing the following query:
explain analyze SELECT * FROM my.tablename WHERE node = '1234567890' AND
date BETWEEN '2005-03-27' AND NOW() ORDER BY id DESC
takes 1,3 sec. with this result:
Sort (cost=52971.52..53033.26 rows=24693 width=93) (actual
time=1141.002..1252.995 rows=25109 loops=1)
S