Received: from zenon.apartia.com (APoncelet-101-2-1-171.abo.wanadoo.fr [193.251.42.171]) by postgresql.org (8.11.3/8.11.4) with ESMTP id g169oaE97058 for ; Wed, 6 Feb 2002 04:50:37 -0500 (EST) (envelope-from isabelle@apartia.fr) Received: from localhost (argos.apartia.int [10.0.2.1]) by zenon.apartia.com (Postfix) with SMTP id DC5B16B36B; Wed, 6 Feb 2002 10:50:33 +0100 (CET) Received: by localhost (sSMTP sendmail emulation); Wed, 6 Feb 2002 10:50:20 +0100 Date: Wed, 6 Feb 2002 10:50:20 +0100 From: Isabelle Brette To: Chris Ruprecht Cc: pgsql-sql@postgresql.org Subject: Re: indexes Message-ID: <20020206095020.GA1124@aparima.com> Reply-To: isabelle@apartia.fr References: <20020205170524.GA1990@aparima.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.3.27i X-Archive-Number: 200202/67 X-Sequence-Number: 6497 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