pg.ddx.io  pgsql-sql@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Isabelle Brette <isabelle@apartia.fr>
To: Chris Ruprecht <chrup999@yahoo.com>
Cc: pgsql-sql@postgresql.org
Subject: Re: indexes
Date: Wed, 6 Feb 2002 10:50:20 +0100
Message-ID: <20020206095020.GA1124@aparima.com> (raw)
In-Reply-To: <p05101211b885cb366c7c@[192.168.0.6]>
References: <20020205170524.GA1990@aparima.com>
	<p05101211b885cb366c7c@[192.168.0.6]>

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



view thread (22+ messages)  latest in thread

Message-ID: <20020206095020.GA1124@aparima.com>
Permalink:  ../20020206095020.GA1124@aparima.com/
Also on:    postgresql.org/message-id/20020206095020.GA1124@aparima.com

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: pgsql-sql@postgresql.org
  Cc: isabelle@apartia.fr, chrup999@yahoo.com
  Subject: Re: indexes
  In-Reply-To: <20020206095020.GA1124@aparima.com>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox