Re: [PERFORM] Weird query speed

2004-01-15 Thread Tom Lane
"Rigmor Ukuhe" <[EMAIL PROTECTED]> writes: > query: select "NP_ID" from a WHERE "NP_ID" > '0' [is slow] > > query: select "NP_ID" from a WHERE "NP_ID" > '1' [is fast] > > There are about 37K rows and only about 100 of then are not "NP_ID" = 0 Yeah, it's scanning over all the zero values when you

[PERFORM] Weird query speed

2004-01-15 Thread Rigmor Ukuhe
Almoust identical querys are having very different exec speed (Postgresql 7.2.4). query: select "NP_ID" from a WHERE "NP_ID" > '0' Index Scan using NP_ID_a on a (cost=0.00..13.01 rows=112 width=4) (actual time=16.89..18.11 rows=93 loops=1) Total runtime: 18.32 msec --