From: | "Miguel BR" <yourpadre(at)omnilect(dot)com> |
---|---|
To: | pgsql-es-ayuda(at)postgresql(dot)org |
Subject: | Problema con indice |
Date: | 2004-11-18 20:41:21 |
Message-ID: | 34107.200.94.197.117.1100810481.squirrel@mail.omnilect.com |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Thread: | |
Lists: | pgsql-es-ayuda |
Tengo esta consulta
select * from folio f
where f.capturo=3
que al revisarla con explaine analyze sale esto
QUERY PLAN
-----------------------------------------------------------------------------------------------------------------
Seq Scan on folio f (cost=0.00..11272.08 rows=93676 width=52) (actual
time=0.481..3191.285 rows=85950 loops=1)
Filter: (capturo = 3)
Total runtime: 3319.928 ms
(3 rows)
pero la duda es porque NO usa el infice si el campo si lo tiene
Esta es mi tabla
CREATE TABLE public.folio
(
folio varchar(9) NOT NULL,
placa varchar(12) NOT NULL,
fecha date NOT NULL,
articulo int4 NOT NULL,
condonado date,
capturo int4 NOT NULL,
fechacaptura date NOT NULL DEFAULT ('now'::text)::date,
id serial NOT NULL,
tipo int4 NOT NULL,
CONSTRAINT folio_pkey PRIMARY KEY (folio),
CONSTRAINT articulo_folio FOREIGN KEY (articulo) REFERENCES
public.articulo (clave) ON UPDATE NO ACTION ON DELETE NO ACTION,
CONSTRAINT capturista_folio FOREIGN KEY (capturo) REFERENCES
public.capturista (id) ON UPDATE NO ACTION ON DELETE NO ACTION,
CONSTRAINT placa_folio FOREIGN KEY (tipo) REFERENCES public.placa
(orden) ON UPDATE CASCADE ON DELETE RESTRICT,
CONSTRAINT folio_condonado CHECK condonado >= fecha
) WITH OIDS;
y el indice (existe 6 personas que capturan)
CREATE INDEX folio_capturo_index
ON public.folio
USING btree
(capturo);
______________________________
http://www.omnilect.com
Omnilect - 2,000 Megabytes Of Storage... Just For You.
Email, Web Space, Photos, Whatever.
Great Usernames Still Available!
From | Date | Subject | |
---|---|---|---|
Next Message | Juanky Moral | 2004-11-18 21:58:46 | Re: Fallo al levantar postgres, no escribe el pid!! |
Previous Message | José Vega | 2004-11-18 20:37:07 | Modelador para postgresql |