Não é cache. É falta de tato ao explicar o problema.
   Ao invés de criar o campo value como numeric, use integer. Em seguida,
faça o teste.

novo=# create table tablefoo2(anytext varchar(100), valor serial);;
NOTA:  CREATE TABLE criará sequência implícita "tablefoo2_valor_seq" para
coluna serial "tablefoo2.valor"
CREATE TABLE
Tempo: 23,205 ms
novo=# insert into tablefoo2(anytext) select 'iteration
'||to_char(random()*100,'99D999') from generate_series(0,50000);
INSERT 0 50001
s
Tempo: 1,615 ms

select 1 from tablefoo2 where valor = 1;
 ?column?
----------
        1
(1 registro)

*Tempo: 24,209 ms*
novo=# select 1 from tablefoo2 where valor = 1::numeric;
 ?column?
----------
        1
(1 registro)

*Tempo: 55,790 ms*


2008/8/5 Shander Lyrio <[EMAIL PROTECTED]>

>
> Osvaldo Rosario Kussama wrote:
> > William:
> >
> > Só para fins de esclarecimento: Você pode rodar as duas consultas
> > acima mas em ordem invertida? Isso é:
> > Primeiro: select 1 from xmls_logs where xml_id = '534';
> > e logo depois: select 1 from xmls_logs where xml_id = '534'::numeric;
> > e reportar os tempos obtidos?
>
>         Matou a questão do cache de páginas de forma muito mais elegante
> Osvaldo, preciso aprender contigo.
>
> --
> Shander Lyrio
> _______________________________________________
> pgbr-geral mailing list
> [email protected]
> https://listas.postgresql.org.br/cgi-bin/mailman/listinfo/pgbr-geral
>



-- 
William Leite Araújo
Analista de Banco de Dados - QualiConsult
_______________________________________________
pgbr-geral mailing list
[email protected]
https://listas.postgresql.org.br/cgi-bin/mailman/listinfo/pgbr-geral

Responder a