types & index usage - Mailing list pgsql-general

From Timur Irmatov
Subject types & index usage
Date
Msg-id 746750156.20030123131425@sarkor.com
Whole thread Raw
List pgsql-general
Hi!

I have a table with year, month, day and hour fields (all SMALLINT
type).  Selecting one row from it takes about 40 msecs, and I am
trying now to use DATE type instead of first three fields.

Now select time decreased to less than millisecond, but I found that i
must use this form: hour=10::smallint instead of simple hour=10,
because in the latter case PostgreSQL does sequential scan.

I've heard something about type coercion issues, so I just want to say
that it is very funny to see such sort of things...


pgsql-general by date:

Previous
From: "Ivar"
Date:
Subject: ??? Multiple selects in procedure
Next
From: "codeWarrior"
Date:
Subject: Re: agregates