Received: from p1.selectacast.net (p1.selectacast.net [64.15.230.162]) by postgresql.org (8.11.3/8.11.4) with ESMTP id f9J0PvP82758 for ; Thu, 18 Oct 2001 20:25:57 -0400 (EDT) (envelope-from jks@selectacast.net) Received: from selectacast.net (IDENT:jks@d1 [64.7.9.58]) by p1.selectacast.net (8.9.3/8.9.3) with ESMTP id UAA07718 for ; Thu, 18 Oct 2001 20:25:44 -0400 Message-ID: <3BCF7308.4060302@selectacast.net> Date: Thu, 18 Oct 2001 20:25:44 -0400 From: Joseph Shraibman Organization: Xtenit, Inc. http://www.xtenit.com User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:0.9.5) Gecko/20011012 X-Accept-Language: en-us MIME-Version: 1.0 To: pgsql-sql Subject: index question Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit X-Archive-Number: 200110/265 X-Sequence-Number: 5219 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