I have a weird problem and don't even know where to begin. First let
me explain what is going on.
I am developing on a Postgres 7.1.3 box and found this unexplainable delay
on this query
select * from webfinal where w_artistkey = 'MICBUR' order by w_date offset
2 limit 4;
I get at least a 8-9 second delay. If I take either the 'order by' or
the 'limit' off the results are immediate. I have several other postgres
boxes 7.1.1 and there is no delay using this query, here is what I'm getting
with explain, but I don't know why?
notifydev=# explain select * from webfinal where w_artistkey = 'MICBUR'
order by w_date offset 2 limit 4;
NOTICE: QUERY PLAN: Limit (cost=39.97..119.91 rows=4 width=109)
-> Index Scan using webfinal_w_date on webfinal (cost=0.00..10563.49 rows=529 width=109) EXPLAIN
notifydev=# explain select * from webfinal where w_artistkey = 'MICBUR' order by w_date offset 2; NOTICE: QUERY PLAN: Limit (cost=999.97..999.97 rows=527 width=109)
-> Sort (cost=999.97..999.97 rows=529 width=109) -> Index Scan using wf_ak1023165516 on webfinal (cost=0.00..976.06 rows=529 width=109) EXPLAIN
Now I run explain on a 7.1.3 box
news=# explain select * from webfinal where w_artistkey = 'MICBUR' order by
w_date offset 2 limit 4;
NOTICE: QUERY PLAN: Limit (cost=924.71..924.71 rows=4 width=109)
-> Sort (cost=924.71..924.71 rows=498 width=109) -> Index Scan using wf_ak1027580700 on webfinal (cost=0.00..902.38 rows=498 width=109) EXPLAIN
can someone explain this to me? Please send response directly as I am not
on the list.
|