types & index usage

From: Timur Irmatov <thor(at)sarkor(dot)com>
To: pgsql-performance(at)postgresql(dot)org
Cc: pgsql-general(at)postgresql(dot)org
Subject: types & index usage
Date: 2003-01-23 08:14:25
Message-ID: 746750156.20030123131425@sarkor.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general pgsql-performance

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...

Browse pgsql-general by date

  From Date Subject
Next Message kanchana 2003-01-23 08:22:15 Re: Fw: configure error with krb5
Previous Message Bjorn Metzdorf 2003-01-23 08:07:36 Re: tsearch comments

Browse pgsql-performance by date

  From Date Subject
Next Message Tomasz Myrta 2003-01-23 08:20:09 Re: Same query, same performance
Previous Message Tom Lane 2003-01-23 06:07:47 Re: Query plan and Inheritance. Weird behavior