pg.ddx.io  pgsql-sql@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Joseph Shraibman <jks@selectacast.net>
To: pgsql-sql <pgsql-sql@postgresql.org>
Subject: index question
Date: Thu, 18 Oct 2001 20:25:44 -0400
Message-ID: <3BCF7308.4060302@selectacast.net> (raw)

Lets say I have a table with columns a and b.  I want to do a query like
SELECT count(distinct b) WHERE a = 2;

Should I have an index on a or an index on (a,b)?

-- 
Joseph Shraibman
jks@selectacast.net
Increase signal to noise ratio.  http://www.targabot.com




view thread (5+ messages)  latest in thread

Message-ID: <3BCF7308.4060302@selectacast.net>
Permalink:  ../3BCF7308.4060302@selectacast.net/
Also on:    postgresql.org/message-id/3BCF7308.4060302@selectacast.net

 · 

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: jks@selectacast.net
  Subject: Re: index question
  In-Reply-To: <3BCF7308.4060302@selectacast.net>

* 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