index question - Mailing list pgsql-sql

From Joseph Shraibman
Subject index question
Date
Msg-id 3BCF7308.4060302@selectacast.net
Whole thread Raw
Responses Re: index question  (Tom Lane <tgl@sss.pgh.pa.us>)
List pgsql-sql
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



pgsql-sql by date:

Previous
From: Stephan Szabo
Date:
Subject: Re: COUNT func
Next
From: Tom Lane
Date:
Subject: Re: When will vacuum go away?