Received: from localhost (postgresql.org [64.49.215.8]) by postgresql.org (Postfix) with ESMTP id 8F1A4476FB1 for ; Thu, 23 Jan 2003 03:21:30 -0500 (EST) Received: from mail.sarkor.com (unknown [81.95.224.36]) by postgresql.org (Postfix) with SMTP id 5BBE94769B2 for ; Thu, 23 Jan 2003 03:14:24 -0500 (EST) Received: (qmail 8423 invoked by uid 507); 23 Jan 2003 08:14:20 -0000 Received: from thor@sarkor.com by mail.sarkor.com by uid 504 with qmail-scanner-1.14 (clamscan: 0.51. Clear:. Processed in 0.685745 secs); 23 Jan 2003 08:14:20 -0000 Received: from unknown (HELO timur) (81.95.224.66) by mail.sarkor.com with SMTP; 23 Jan 2003 08:14:19 -0000 Date: Thu, 23 Jan 2003 13:14:25 +0500 From: Timur Irmatov X-Mailer: The Bat! (v1.61) Reply-To: Timur Irmatov X-Priority: 3 (Normal) Message-ID: <746750156.20030123131425@sarkor.com> To: pgsql-performance@postgresql.org Cc: pgsql-general@postgresql.org Subject: types & index usage MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-Virus-Scanned: by AMaViS new-20020517 X-Archive-Number: 200301/967 X-Sequence-Number: 36088 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...