X-Original-To: pgsql-performance-postgresql.org@localhost.postgresql.org Received: from localhost (unknown [200.46.204.2]) by svr1.postgresql.org (Postfix) with ESMTP id 6CD0ED1E9D7 for ; Wed, 31 Mar 2004 14:27:51 +0000 (GMT) Received: from svr1.postgresql.org ([200.46.204.71]) by localhost (neptune.hub.org [200.46.204.2]) (amavisd-new, port 10024) with ESMTP id 32457-04 for ; Wed, 31 Mar 2004 10:27:50 -0400 (AST) Received: from hotmail.com (bay8-f7.bay8.hotmail.com [64.4.27.7]) by svr1.postgresql.org (Postfix) with ESMTP id 69A78D1E9B4 for ; Wed, 31 Mar 2004 10:27:46 -0400 (AST) Received: from mail pickup service by hotmail.com with Microsoft SMTPSVC; Wed, 31 Mar 2004 06:27:50 -0800 Received: from 69.65.137.210 by by8fd.bay8.hotmail.msn.com with HTTP; Wed, 31 Mar 2004 14:27:50 GMT X-Originating-IP: [69.65.137.210] X-Originating-Email: [el_vigia_ec@hotmail.com] X-Sender: el_vigia_ec@hotmail.com From: "Jaime Casanova" To: pgsql-performance@postgresql.org Subject: Re: select slow? Date: Wed, 31 Mar 2004 14:27:50 +0000 Mime-Version: 1.0 Content-Type: text/plain; format=flowed Message-ID: X-OriginalArrivalTime: 31 Mar 2004 14:27:50.0289 (UTC) FILETIME=[586F1010:01C4172C] X-Virus-Scanned: by amavisd-new at postgresql.org X-Archive-Number: 200403/440 X-Sequence-Number: 6296 > >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