Re: [HACKERS] using hash index when BETWEEN is specified

2008-09-10 Thread Tom Lane
Zdenek Kotala <[EMAIL PROTECTED]> writes: > I think it depends of ration of unique integer number in a table and > numbers of requested interval, number distribution and total number of rows. > For example if you have 10 distinct number and each has 100 occurrence > then full scan is better (for

Re: [HACKERS] using hash index when BETWEEN is specified

2008-09-10 Thread Zdenek Kotala
Hannu Krosing napsal(a): On Wed, 2008-09-10 at 07:13 -0400, Robert Haas wrote: I'm not planner guru but it seems to me that BETWEEN clause could be rewritten as a IN clause for integer data types and small interval. Where should the line be drawn. Define small :) When the estimated cost is low

Re: [HACKERS] using hash index when BETWEEN is specified

2008-09-10 Thread Hannu Krosing
On Wed, 2008-09-10 at 07:13 -0400, Robert Haas wrote: > >> I'm not planner guru but it seems to me that BETWEEN clause could be > >> rewritten as a IN clause for integer data types and small interval. > > > > Where should the line be drawn. > > Define small :) > > When the estimated cost is lower?

Re: [HACKERS] using hash index when BETWEEN is specified

2008-09-10 Thread Robert Haas
>> I'm not planner guru but it seems to me that BETWEEN clause could be >> rewritten as a IN clause for integer data types and small interval. > > Where should the line be drawn. > Define small :) When the estimated cost is lower? ...Robert -- Sent via pgsql-hackers mailing list (pgsql-hackers@

Re: [HACKERS] using hash index when BETWEEN is specified

2008-09-10 Thread Asko Oja
On Wed, Sep 10, 2008 at 1:39 PM, Zdenek Kotala <[EMAIL PROTECTED]>wrote: > I has played with new hash index implementation and I tried following > command: > > postgres=# select * from test where id between 1 and 5; > Time: 9651,033 ms > postgres=# explain select * from test where id between 1 and

[HACKERS] using hash index when BETWEEN is specified

2008-09-10 Thread Zdenek Kotala
I has played with new hash index implementation and I tried following command: postgres=# select * from test where id between 1 and 5; Time: 9651,033 ms postgres=# explain select * from test where id between 1 and 5; QUERY PLAN -