From: Jaime Casanova <el_vigia_ec@hotmail.com>
To: pgsql-performance@postgresql.org
Subject: Re: select slow?
Date: Wed, 31 Mar 2004 14:27:50 +0000
Message-ID: <BAY8-F7R0ZJi4W8StO00001d4b4@hotmail.com> (raw)
>
>On Tuesday 30 March 2004 20:25, Jaime Casanova wrote:
>>hi all,
> >
> >
> > i have an amd athlon with 256 ram (i know, this is not a *real* server
>but
> > my tables are small)
>Nothing wrong with it - it's what I still use as my development server.
>
> > i'm using vb6 (win98) with pgsql-7.3.4 (rh8) trough the psqlodbc.
> >
> > when i do a select in took long to execute, here is an example
>
> > CREATE TABLE ICC_M_BANCO (
> > CodBanco SMALLINT NOT NULL,
> > select * from icc_m_banco where codbanco = 1;
> >
> > it tooks 13s from it's send until it's executed.
>
>Try:
> SELECT * FROM icc_m_banco WHERE codbanco = 1::smallint;
>
>By default, PG will treat a numeric constant as integer not smallint, so
>when
>it looks for an index it can't find one for integer, so scans instead.
>
>--
> Richard Huxton
> Archonet Ltd
There are no indexes yet, and the table is just 6 rows long so even if
indexes exists the planner will do a seq scan. that's my whole point 63m for
seq scan in 6 rows table is too much.
_________________________________________________________________
The new MSN 8: smart spam protection and 2 months FREE*
http://join.msn.com/?page=features/junkmail
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: el_vigia_ec@hotmail.com
Subject: Re: select slow?
In-Reply-To: <BAY8-F7R0ZJi4W8StO00001d4b4@hotmail.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