X-Original-To: pgsql-sql@postgresql.org Received: from spampd.localdomain (postgresql.org [64.49.215.8]) by postgresql.org (Postfix) with ESMTP id 9D958475F1C for ; Mon, 14 Apr 2003 18:09:16 -0400 (EDT) Received: from pop3.attla.net.ar (pop3.attla.net.ar [200.61.33.136]) by postgresql.org (Postfix) with ESMTP id 7FE2E47580B for ; Mon, 14 Apr 2003 18:09:15 -0400 (EDT) Received: from keko.com.ar ([200.61.33.190]) by pop3.attla.net.ar (InterMail vK.4.03.01.00 201-232-122 license c284b6697c24beb7e22a6d41beae4243) with SMTP id <20030414220704.IHDE15161.pop3@keko.com.ar> for ; Mon, 14 Apr 2003 19:07:04 -0300 From: "mdc@keko.com.ar" To: pgsql-sql@postgresql.org Subject: help with query!!! X-Mailer: WebMAIL to Mail Gateway v3.0e Date: Mon, 14 Apr 2003 19:07:14 -0300 Message-id: <3e9b3112.22ad.16838@keko.com.ar> MIME-Version: 1.0 Content-Type: text/plain Content-Transfer-Encoding: quoted-printable X-Spam-Status: No, hits=-1.4 required=5.0 tests=BAYES_20,PLING_PLING version=2.50 X-Spam-Level: X-Spam-Checker-Version: SpamAssassin 2.50 (1.173-2003-02-20-exp) X-Archive-Number: 200304/211 X-Sequence-Number: 12912 hi all i=B4m have one query (see below) and not is possible to me optimize, so moving to postgres release 7.3.2 but i=B4cant optimize the query an don't understood why additional data. the table shape Table "public.Transitos" Column | Type | Modifiers -----------------+-----------------------------+----------- codigoEstacion | character(2) | not null numeroVia | smallint | not null fechaHora | timestamp(3) with time zone | not null medioPago | character varying(50) | not null tipoTransito | character(20) | not null categoria | character(20) | not null controlTransito | character varying(50) | not null controlPago | character varying(50) | not null descripcion | character varying(150) | not null Indexes: transitos_pkey primary key btree ("codigoEstacion", "numeroVia", "fechaHora", "medioPago", "tipoTransito", categoria), i_t2 btree ("codigoEstacion", "numeroVia", "fechaHora", "medioPago", "tipoTransito", categoria), i_transitos btree ("codigoEstacion", "numeroVia", "fechaHora", "medioPago", "tipoTransito", categoria), it_3 btree ("codigoEstacion", "numeroVia", "fechaHora", "tipoTransito", "medioPago", categoria) the querie: explain delete from "Transitos" where "codigoEstacion"=3D '02' and "numeroVia" =3D 1 and "fechaHora" =3D '2003-0403 17:34:06.92'::timestamp and "medioPago" =3D 'Efectivo' and "tipoTransito"=3D 'Normal' and categoria=3D'01' result: Seq Scan on "Transitos" (cost=3D0.00..10612.03 rows=3D1 width=3D6) Filter: (("codigoEstacion" =3D '02'::bpchar) AND ("numeroVia" =3D 1) AND ("fechaHora" =3D ('2003-04-03 17:34:06.92'::timestamp without time zone)::timestamp with time zone) AND ("medioPago" 'Efectivo'::character varying) AND ("tipoT= ransito" 'Normal'::bpchar) AND (categoria =3D '01'::bpchar)) (2 rows) question: why them perform one seq scan ? if you see have index covering where expression ? any ideas? TIA PD: SORRY FOR MY ENGLISH IS NOT MY MOTHER LANGUAGE =3D;o) --------------------------------------- =BFTodav=EDa no naveg=E1s con Keko? Hac=E9 click aqu=ED: http://www.keko.com.ar