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 32232D1EA1F for ; Wed, 31 Mar 2004 08:33:44 +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 06299-05 for ; Wed, 31 Mar 2004 04:33:30 -0400 (AST) Received: from anchor-post-30.mail.demon.net (anchor-post-30.mail.demon.net [194.217.242.88]) by svr1.postgresql.org (Postfix) with ESMTP id CF897D1E9BF for ; Wed, 31 Mar 2004 04:33:28 -0400 (AST) Received: from mwynhau.demon.co.uk ([193.237.186.96] helo=mainbox.archonet.com) by anchor-post-30.mail.demon.net with esmtp (Exim 3.35 #1) id 1B8bA9-000MlD-0U; Wed, 31 Mar 2004 09:33:29 +0100 Received: by mainbox.archonet.com (Postfix, from userid 529) id 6995816A93; Wed, 31 Mar 2004 09:33:28 +0100 (BST) Received: from client17.archonet.com (client17.archonet.com [192.168.1.17]) by mainbox.archonet.com (Postfix) with ESMTP id 3BB9015988; Wed, 31 Mar 2004 09:33:25 +0100 (BST) From: Richard Huxton To: "Jaime Casanova" , pgsql-performance@postgresql.org Subject: Re: select slow? Date: Wed, 31 Mar 2004 09:33:24 +0100 User-Agent: KMail/1.5 References: In-Reply-To: MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit Content-Disposition: inline Message-Id: <200403310933.24397.dev@archonet.com> X-Bogosity: No, tests=bogofilter, spamicity=0.000000, version=0.15.3 X-Virus-Scanned: by amavisd-new at postgresql.org X-Archive-Number: 200403/437 X-Sequence-Number: 6293 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