types & index usage
types & index usage
От:
Timur Irmatov <thor@sarkor.com>
Дата:
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...