Re: indexes - Mailing list pgsql-sql

From Isabelle Brette
Subject Re: indexes
Date
Msg-id 20020206095020.GA1124@aparima.com
Whole thread Raw
In response to Re: indexes  (Chris Ruprecht <chrup999@yahoo.com>)
List pgsql-sql
Hi again,

On Tue, Feb 05, 2002 at 11:50:52AM -0600, Chris Ruprecht wrote:
> Isabella,

Mh, it's Isabelle, thanks.

> I would do a
> create index sess_created on sessions (ip, to_char);
> 
> This satisfies the where clause and might help in the group by.

This does not seem to work.

One thing or two I did not say in my previous post :

- the 'created' column is a timestamp, so the to_char function needs a second argument to know which format to use. 
- the 'ip' column is of postgres type inet, that's why I use the << operator.

- for some other queries, I also need a filter on IPs but not on the timestamp.

For the ip thing, I just looked at the doc and it seems a '<<' operator
on inet columns just can't use an indexed column properly. All I can do
is simple comparisons such as <, <=, =, >=, > (only the btree access
method is implemented in my current version of Postgres : 7.1.3 ; will
this change in 7.2 ?).

-- 
Isabelle Brette - isabelle@apartia.fr


pgsql-sql by date:

Previous
From: Murray Prior Hobbs
Date:
Subject: practical limitations to number of postgres user accounts
Next
From: Stephan Szabo
Date:
Subject: Re: indexes