Re: Query Plan - Index Scan & Seq Scan - Mailing list pgsql-admin

From Tom Lane
Subject Re: Query Plan - Index Scan & Seq Scan
Date
Msg-id 6708.1115915406@sss.pgh.pa.us
Whole thread Raw
In response to Re: Query Plan - Index Scan & Seq Scan  (Prasanth <dbadmin@nqadmin.com>)
Responses Re: Query Plan - Index Scan & Seq Scan  (Prasanth <dbadmin@nqadmin.com>)
Re: Query Plan - Index Scan & Seq Scan  (Prasanth <dbadmin@nqadmin.com>)
Re: Query Plan - Index Scan & Seq Scan  (Prasanth <dbadmin@nqadmin.com>)
List pgsql-admin
Prasanth <dbadmin@nqadmin.com> writes:
> code data type is int2.

Ah-hah.  So "where code > 2::int2" should work noticeably better for
you.  Or you could do "where code > '2'" to avoid hard-wiring the data
type knowledge into your queries.  Or just change it to int4 ;-)
Or update to 8.0.

            regards, tom lane

pgsql-admin by date:

Previous
From: Prasanth
Date:
Subject: Re: Query Plan - Index Scan & Seq Scan
Next
From: Prasanth
Date:
Subject: Re: Query Plan - Index Scan & Seq Scan