Received: from localhost (postgresql.org [64.49.215.8]) by postgresql.org (Postfix) with ESMTP id 71E7F47688D; Wed, 9 Oct 2002 12:57:14 -0400 (EDT) Received: from aquilandia.com (unknown [195.55.211.234]) by postgresql.org (Postfix) with ESMTP id AD2FF4765B3; Wed, 9 Oct 2002 12:57:09 -0400 (EDT) Received: from leo [213.97.49.3] by aquilandia.com (SMTPD32-6.06) id A27C3A3C005E; Wed, 09 Oct 2002 19:08:12 +0200 From: "Jose Antonio Leo" To: , Subject: problem with the Index Date: Wed, 9 Oct 2002 18:56:41 +0200 Message-ID: MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit X-Priority: 3 (Normal) X-MSMail-Priority: Normal X-Mailer: Microsoft Outlook IMO, Build 9.0.2416 (9.0.2910.0) Importance: Normal In-Reply-To: <19697.1034170370@sss.pgh.pa.us> X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2600.0000 X-Virus-Scanned: by AMaViS new-20020517 X-Archive-Number: 200210/513 X-Sequence-Number: 31511 I have a problem with the index of 1 table. I hava a table created : CREATE TABLE "acucliart" ( "cod_pto" numeric(8,0) NOT NULL, "cod_cli" varchar(9) NOT NULL, "mes" numeric(2,0) NOT NULL, "ano" numeric(4,0) NOT NULL, "int_art" numeric(5,0) NOT NULL, "cantidad" numeric(12,2), "ven_siv_to" numeric(14,2), "ven_civ_to" numeric(14,2), "tic_siv_to" numeric(14,2), "tic_civ_to" numeric(14,2), "visitas" numeric(2,0), "ult_vis" date, "ven_cos" numeric(12,2), "ven_ofe" numeric(12,2), "cos_ofe" numeric(12,2), CONSTRAINT "acucliart_pkey" PRIMARY KEY ("cod_cli") ); if i do this select: explain select * from acucliart where cod_cli=10000; postgres use the index NOTICE: QUERY PLAN: Index Scan using cod_cli_ukey on acucliart (cost=0.00..4.82 rows=1 width=478) and this select explain select * from acucliart where cod_cli>10000; Postgres don't use the index: NOTICE: QUERY PLAN: Seq Scan on acucliart (cost=0.00..22.50 rows=333 width=478) why? tk