inet data type to see if
there are differences.
Sriram
-Original Message-
From: Jim C. Nasby [mailto:[EMAIL PROTECTED]
Sent: Tuesday, April 25, 2006 11:25 AM
To: Sriram Dandapani
Cc: Pgsql-Performance (E-mail)
Subject: Re: [PERFORM] planner not using index for like operator
On Tue, Apr 2
the inet data type?
Thanks
Sriram
-Original Message-
From: Jim C. Nasby [mailto:[EMAIL PROTECTED]
Sent: Tuesday, April 25, 2006 11:25 AM
To: Sriram Dandapani
Cc: Pgsql-Performance (E-mail)
Subject: Re: [PERFORM] planner not using index for like operator
On Tue, Apr 25, 2006 at 10:08
On Tue, Apr 25, 2006 at 10:08:02AM -0700, Sriram Dandapani wrote:
Here's the key:
> " Filter: ((col1)::text ~~ '172.%'::text)"
In order to do a like comparison, it has to convert col1 (which I'm
guessing is of type 'inet') to text, so there's no way it can use an
index on col1 (maybe a function
PROTECTED]
[mailto:[EMAIL PROTECTED] On Behalf Of Sriram
DandapaniSent: Tuesday, April 25, 2006 12:08 PMTo:
Pgsql-Performance (E-mail)Subject: [PERFORM] planner not using
index for like operator
For the
query
Select col1 from
table1
Where col1 like
‘172
For the query
Select col1 from table1
Where col1 like ‘172.%’
The table has 133 million unique ip addresses. Col1 is
indexed.
The optimizer is using a sequential scan
This is the explain analyze output
"Seq Scan on table1 (cost=0.00..2529284.80 rows=1
width=15) (actu