[Pgsql-ayuda] Re: ¿Cómo se come esto?

Antonio Mármol Albert toni@infurma.combios.es
Thu, 28 Nov 2002 15:23:40 +0100


El jueves 28 de noviembre de 2002  (08:23), J. Mario Oroz escribió:

> Me queda una duda; que dice postgres al hacer  un explain del select que
> posteaste una ves que reindexaste?
> 
> Te vuelve a decir que realiza un "Seq Scan";

habitat=# EXPLAIN SELECT id, marca FROM empresas WHERE id=21293::bigint;
NOTICE:  QUERY PLAN:

Seq Scan on empresas  (cost=0.00..981.79 rows=1 width=86)

EXPLAIN

> 
> y si en ves de colocar como parametro para id; "id =21293::bigint" pones lo
> siguiente:
> "id=21293::int4" ó "id=21293::int8" y haces un explain..... vuelve a dar
> "Seq Scan".

habitat=# EXPLAIN SELECT id, marca FROM empresas WHERE id=21293::int4;
NOTICE:  QUERY PLAN:

Index Scan using empresas_pkey on empresas  (cost=0.00..6.01 rows=1
width=86)

EXPLAIN



habitat=# EXPLAIN SELECT id, marca FROM empresas WHERE id=21293::int8;
NOTICE:  QUERY PLAN:

Seq Scan on empresas  (cost=0.00..981.79 rows=1 width=86)

EXPLAIN


Saludos
-- 
Antonio Mármol Albert ( toni@infurma.es )
http://www.infurma.es