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 31F5653B3D for ; Thu, 21 Apr 2005 17:40:26 -0300 (ADT) 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 95385-02 for ; Thu, 21 Apr 2005 20:39:44 +0000 (GMT) Received: from web30314.mail.mud.yahoo.com (web30314.mail.mud.yahoo.com [68.142.201.232]) by svr1.postgresql.org (Postfix) with SMTP id C596A538E8 for ; Thu, 21 Apr 2005 17:39:26 -0300 (ADT) Received: (qmail 72225 invoked by uid 60001); 21 Apr 2005 20:39:27 -0000 Comment: DomainKeys? See http://antispam.yahoo.com/domainkeys DomainKey-Signature: a=rsa-sha1; q=dns; c=nofws; s=s1024; d=yahoo.com; b=EgTFJIZ1HHVCM61feDxLMO2i5NmehzX43xGlEcbCqX0QpZnCTZLZfnuaa0alSCW+xeDP7WpwzjGmW1js5lR9roNCVDNOC5tsZrukEHuSWRl1zEYHDvLxwg5xKRas30mvVG0H94IulsVASRx7y0EdgkTJ5LIN76hbOlgx9MVOkec= ; Message-ID: <20050421203927.72223.qmail@web30314.mail.mud.yahoo.com> Received: from [63.78.249.254] by web30314.mail.mud.yahoo.com via HTTP; Thu, 21 Apr 2005 13:39:27 PDT Date: Thu, 21 Apr 2005 13:39:27 -0700 (PDT) From: Litao Wu Subject: Re: index not used To: weigelt@metux.de, postgresql performance list In-Reply-To: 6667 MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Virus-Scanned: by amavisd-new at hub.org X-Spam-Status: No, hits=1.989 tagged_above=0 required=5 tests=AWL, DNS_FROM_RFC_ABUSE, FORGED_YAHOO_RCVD X-Spam-Level: * X-Archive-Number: 200504/594 X-Sequence-Number: 11991 If id is PK, the query shoudl return 1 row only... --- Enrico Weigelt wrote: > > Hi folks, > > > I'm doing a simple lookup in a small table by an > unique id, and I'm > wondering, why explains tells me seqscan is used > instead the key. > > The table looks like: > > id bigint primary key, > a varchar, > b varchar, > c varchar > > and I'm quering: select * from foo where id = 2; > > I've got only 15 records in this table, but I wanna > have it as > fast as possible since its used (as a map between > IDs and names) > for larger queries. > > > thx > -- > --------------------------------------------------------------------- > Enrico Weigelt == metux IT service > > phone: +49 36207 519931 www: > http://www.metux.de/ > fax: +49 36207 519932 email: > contact@metux.de > cellphone: +49 174 7066481 > --------------------------------------------------------------------- > -- DSL ab 0 Euro. -- statische IP -- UUCP -- > Hosting -- Webshops -- > --------------------------------------------------------------------- > > ---------------------------(end of > broadcast)--------------------------- > TIP 8: explain analyze is your friend > __________________________________ Do you Yahoo!? Yahoo! Small Business - Try our new resources site! http://smallbusiness.yahoo.com/resources/