Received: from makus.postgresql.org ([98.129.198.125]) by malur.postgresql.org with esmtp (Exim 4.72) (envelope-from
2012/10/15 Pedro Jim=C3=A9nez <p.jimenez@ismsola= r.com>:Hello, I'm trying to do a simple SQL query over Postgresl 9.0 running on Ubunt= u. I have a large table (over 100 million records) with three fields, id_sig= nal (bigint), time_stamp (timestamp) and var_value (float). My query looks like this: select var_value from ism_floatvalues where id_signal =3D 29660 order by time_stamp desc limit 1; So I want to select the last value from a determinated ID (is_signal). This query runs FOREVER, while if I delete "limit 1" it runs instantly...= .did you ANALYZE your tables? Can you send EXPLAIN ANALYZE result of both queries? Regards Pavel StehuleAny help? Regards. -- Sent via pgsql-performance mailing list (pgsql-performance@= postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-performa= nce
Pedro Jim=C3=A9nez P=C3=
=A9rez
p.jimenez@ismsola=
r.com
|
|
Innovaci=C3=B3n
en Sistemas de Monitorizaci=C3=B3n, S.L.=
|
|
|
Antes de imprimir, piensa en tu responsabilidad y compromiso con el MEDIO AMBIENTE! |
|
Before printing, think about your responsibility and commitment with the ENVIRONMENT! |
CL=C3=81USULA DE CONFIDENCIALIDAD.- Este mensaje, y en su caso, cualquier fichero anexo al mismo, puede contener informaci=C3=B3n confidencial o legalmente protegida (LOPD 15/1999 de 13 de Diciembre), siendo para uso exclusivo del destinatario. No hay renuncia a la confidencialidad o secreto profesional por cualquier transmisi=C3=B3n defectuosa o err=C3=B3nea, y queda expresamente prohibida su divulgaci=C3=B3n, copia o distribuci=C3=B3n a terceros sin la autorizaci=C3=B3n= expresa del remitente. Si ha recibido este mensaje por error, se ruega lo notifique al remitente enviando un mensaje al correo electr=C3=B3nico contacto@ismsolar.com y proceda inmedi= atamente al borrado del mensaje original y de todas sus copias. Gracias por su colaboraci=C3=B3n.