[Pgsql-ayuda] Re: [Pgsql-ayuda] ¿Cómo se come esto?
Antonio Mármol Albert
toni@infurma.combios.es
Wed, 27 Nov 2002 18:46:43 +0100
El miércoles 27 de noviembre de 2002 (11:49), Manuel Sugawara escribió:
> Antonio Mármol Albert <toni@infurma.combios.es> writes:
>
> > (Consulta 1)
> >
> > habitat=# SELECT id, marca FROM empresas WHERE marca = 'Muebles Celda';
> > id | marca
> > -------+---------------
> > 21293 | Muebles Celda
> >
> >
> > (Consulta 2)
> >
> > habitat=# SELECT id, marca FROM empresas WHERE id=21293;
> > id | marca
> > ----+-------
> > (0 rows)
>
> umh, esta raro. Tal vez tienes un índice corrupto; ¿dices que id es
> llave primaria?, tal vez algo como:
>
> reindex empresas_pkey;
habitat=# reindex empresas_pkey;
ERROR: parser: parse error at or near "empresas_pkey"
>
> ayude. ¿qué te dice el explain de abajo?
>
> explain analyze SELECT id, marca FROM empresas WHERE id=21293;
habitat=# explain analyze SELECT id, marca FROM empresas WHERE id=21293;
NOTICE: QUERY PLAN:
Index Scan using empresas_pkey on empresas (cost=0.00..6.01 rows=1
width=86) (actual time=10.77..10.77 rows=0 loops=1)
Total runtime: 10.88 msec
EXPLAIN
habitat=# SELECT id, marca FROM empresas WHERE id=21293;
id | marca
----+-------
(0 rows)
Primero dice "1 rows" y luego "0 rows". Curioso...
--
Antonio Mármol Albert ( toni@infurma.es )
http://www.infurma.es