From: Litao Wu <litaowu@yahoo.com>
To: weigelt@metux.de, postgresql performance list <pgsql-performance@postgresql.org>
Subject: Re: index not used
Date: Thu, 21 Apr 2005 13:39:27 -0700 (PDT)
Message-ID: <20050421203927.72223.qmail@web30314.mail.mud.yahoo.com> (raw)
If id is PK, the query shoudl return 1 row only...
--- Enrico Weigelt <weigelt@metux.de> 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/
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-performance@postgresql.org
Cc: litaowu@yahoo.com
Subject: Re: index not used
In-Reply-To: <20050421203927.72223.qmail@web30314.mail.mud.yahoo.com>
* 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