help with query!!!
От | mdc@keko.com.ar |
---|---|
Тема | help with query!!! |
Дата | |
Msg-id | 3e9b3112.22ad.16838@keko.com.ar обсуждение исходный текст |
Ответы |
Re: help with query!!!
Re: help with query!!! Re: help with query!!! |
Список | pgsql-sql |
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 nullnumeroVia | smallint | not nullfechaHora | timestamp(3) with time zone | not nullmedioPago | character varying(50) | not nulltipoTransito | character(20) | not nullcategoria | character(20) | not nullcontrolTransito | character varying(50) | not nullcontrolPago | character varying(50) | not nulldescripcion | 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
В списке pgsql-sql по дате отправления: