Re: Rv: Tiempo de Consultas

From: "Jaime Casanova" <systemguards(at)gmail(dot)com>
To: rug_vzla(at)hotmail(dot)com
Cc: "Postgre SQL" <pgsql-es-ayuda(at)postgresql(dot)org>
Subject: Re: Rv: Tiempo de Consultas
Date: 2006-11-22 03:41:01
Message-ID: c2d9e70e0611211941i304621bdi6d781942eeb4a2da@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-es-ayuda

On 11/21/06, Rafael Urbina <rug_vzla(at)yahoo(dot)com> wrote:
> Gracias, pero no logro entender la leyenda de EXPLAIN ANALYZE, probe con
> \timing. Y tengo lo sig:
> postgres=# EXPLAIN ANALYZE SELECT * FROM pg_database;
>
> QUERY PLAN
> -------------------------------------------------------------------------------------------------------
> Seq Scan on pg_database (cost=0.00..1.02 rows=2 width=158)
> (actual time=0.013..0.018 rows=3
> loops=1)
> Total runtime: 8.655 ms
> (2 rows)
>
> y con el \timing :
> postgres=# SELECT * FROM pg_database;
> datname | datdba | encoding | datistemplate | datallowconn | datconnlimit
> | datlastsysoid | datvacuumxid | datfrozenxid | dattablespace | datconfig |
> datacl
> -----------+--------+----------+---------------+--------------+--------------+---------------+--------------+--------------+---------------+-----------+------------------------
> postgres | 10 | 6 | f | t | -1
> | 10792 | 499 | 499 | 1663 | |
> template1 | 10 | 6 | t | t | -1
> | 10792 | 499 | 499 | 1663 | |
> {postgres=CT/postgres}
> template0 | 10 | 6 | t | f | -1
> | 10792 | 499 | 499 | 1663 | |
> {postgres=CT/postgres}
> (3 rows)
>
> Time: 0,952 ms
>
> Nose por cual guiarme¿?¿ Se que el EXPLAIN ANALYZE la primera fila la del

En EXPLAIN ANALYZE mira el "total runtime" la razon por la que \timing
reporta un tiempo menor es porque acabas de ejecutar ese query y ya
los datos estan en memoria...

--
Atentamente,
Jaime Casanova

"Programming today is a race between software engineers striving to
build bigger and better idiot-proof programs and the universe trying
to produce bigger and better idiots.
So far, the universe is winning."
Richard Cook

In response to

Responses

Browse pgsql-es-ayuda by date

  From Date Subject
Next Message Raúl Andrés Duque 2006-11-22 04:21:25 Re: Recuperar Base de Datos Postgresqlp 7.4
Previous Message Hensa 2006-11-22 02:15:39 Re: Store Procedure con parametros variables