pg.ddx.io  pgsql-sql@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: mdc@keko.com.ar <mdc@keko.com.ar>
To: pgsql-sql@postgresql.org
Subject: help with query!!!
Date: Mon, 14 Apr 2003 19:07:14 -0300
Message-ID: <3e9b3112.22ad.16838@keko.com.ar> (raw)

hi all

 i´m have one query (see below) and not is possible to
me optimize, so moving to postgres release 7.3.2 but
i´cant 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"= '02' and
"numeroVia" = 1 and
"fechaHora" = '2003-0403 17:34:06.92'::timestamp and
"medioPago" = 'Efectivo' and
"tipoTransito"= 'Normal' and
categoria='01'


result:
 Seq Scan on "Transitos"  (cost=0.00..10612.03 rows=1
width=6)
   Filter: (("codigoEstacion" = '02'::bpchar) AND
("numeroVia" = 1) AND ("fechaHora" = ('2003-04-03
17:34:06.92'::timestamp without time zone)::timestamp
with time zone) AND ("medioPago" 'Efectivo'::character varying) AND ("tipoTransito" 'Normal'::bpchar) AND (categoria = '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 =;o)

---------------------------------------
¿Todavía no navegás con Keko?
Hacé click aquí: http://www.keko.com.ar




view thread (15+ messages)  latest in thread

Message-ID: <3e9b3112.22ad.16838@keko.com.ar>
Permalink:  ../3e9b3112.22ad.16838@keko.com.ar/
Also on:    postgresql.org/message-id/3e9b3112.22ad.16838@keko.com.ar

 · 

reply

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-sql@postgresql.org
  Cc: mdc@keko.com.ar
  Subject: Re: help with query!!!
  In-Reply-To: <3e9b3112.22ad.16838@keko.com.ar>

* 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