Re: [PERFORM] Using bigint needs explicit cast to use the index

2004-03-08 Thread Andrew Sullivan
On Mon, Mar 08, 2004 at 10:26:21AM +1000, Steven Butler wrote: I tested my hunch by casting the constant to bigint (as can be seen below) and suddenly the query is using the index again. Yes. You can make this work all the time by quoting the constant. That is, instead of WHERE

Re: [PERFORM] Using bigint needs explicit cast to use the index

2004-03-08 Thread Neil Conway
Andrew Sullivan wrote: Intended, no. Expected, yes. This topic has had the best Postgres minds work on it, and so far nobody's come up with a solution. Actually, this has already been fixed in CVS HEAD (as I mentioned in this thread yesterday). To wit: nconway=# create table t1 (a int8);

Re: [PERFORM] Using bigint needs explicit cast to use the index

2004-03-07 Thread Neil Conway
Steven Butler wrote: I've recently converted a database to use bigint for the indices. Suddenly simple queries like select * from new_test_result where parent_id = 2 are doing full table scans instead of using the index. This is fixed in CVS HEAD. In the mean time, you can enclose the integer