X-Original-To: pgsql-performance-postgresql.org@localhost.postgresql.org Received: from localhost (unknown [200.46.204.144]) by svr1.postgresql.org (Postfix) with ESMTP id 0CA1F3A55C4 for ; Mon, 6 Dec 2004 16:13:30 +0000 (GMT) Received: from svr1.postgresql.org ([200.46.204.71]) by localhost (av.hub.org [200.46.204.144]) (amavisd-new, port 10024) with ESMTP id 83985-01 for ; Mon, 6 Dec 2004 16:13:04 +0000 (GMT) Received: from boutiquenumerique.com (boutiquenumerique.com [82.67.9.10]) by svr1.postgresql.org (Postfix) with ESMTP id 032B43A5F17 for ; Mon, 6 Dec 2004 16:13:03 +0000 (GMT) Received: (qmail 2977 invoked from network); 6 Dec 2004 17:13:39 +0100 Received: from unknown (HELO musicbox) (boutiquenumerique-lists@192.168.0.2) by boutiquenumerique.com with SMTP; 6 Dec 2004 17:13:39 +0100 To: "Pallav Kalva" Cc: pgsql-performance@postgresql.org Subject: Re: Poor Query References: <41B47A97.1090708@deg.cc> <41B48053.7090805@deg.cc> Message-ID: Date: Mon, 06 Dec 2004 17:16:10 +0100 From: =?iso-8859-15?Q?Pierre-Fr=E9d=E9ric_Caillaud?= Organization: =?iso-8859-15?Q?La_Boutique_Num=E9rique?= Content-Type: text/plain; format=flowed; delsp=yes; charset=iso-8859-15 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit In-Reply-To: <41B48053.7090805@deg.cc> User-Agent: Opera M2/7.54 (Linux, build 751) X-Virus-Scanned: by amavisd-new at hub.org X-Spam-Status: No, hits=0 tagged_above=0 required=5 tests= X-Spam-Level: X-Archive-Number: 200412/114 X-Sequence-Number: 9489 Just wanted to know the selectivity of the accountnumber and routingNumber columns. I shoulda written : >> How many rows do the following queries return : One or few at most, or a lot ? >> >> select userID >> from bankaccount >> WHERE accountnumber = '12345678' >> >> select userID >> from bankaccount >> WHERE routingNumber = '12345678' >> >> Can you post EXPLAIN ANALYZE for these two queries ? >> Regards. >> > Thanks! for the quick reply. It should usually return just one account > for that user so its only one record. Actually userid column doesnt > exist on bankaccount table it exists only on the user table and it is > joined with bankaccountid column, if i run this query separately i > wouldnt able to run it . > >