Re: Queries and views - Mailing list pgsql-general

From Emmanuel SARACCO
Subject Re: Queries and views
Date
Msg-id 3BCCFC3C.70805@noos.fr
Whole thread Raw
In response to Queries and views  ("David Cana" <david@cherrytel.com>)
List pgsql-general
hi,

you can use the EXPLAIN instruction.
"\h EXPLAIN" in psql for help.

bye

David Cana wrote:

> Hello!
>
> I have got a view like:
>
>     create view consulta_material as
>       select
>             material.clave as clave,
>             referencia,
>             sede.nombre_es as nombre_sede, clave_sede,
>             soporte.nombre_es as nombre_soporte, clave_soporte,
>             area_materiales.nombre_es as nombre_area_materiales,
> clave_area_materia
>             autor,
>             titulo,
>             descripcion,
>             fecha_intro, fecha_modificacion
>
>       from material, sede, soporte, area_materiales
>
>       where (material.clave_sede = sede.clave)
>             and (material.clave_soporte = soporte.clave)
>             and (material.clave_area_materiales = area_materiales.clave);
>
> I´d like to know the performance difference between...
>
>     select * from consulta_material where clave=1;
>
> And...
>
>     select
>           material.clave as clave,
>           referencia,
>           sede.nombre_es as nombre_sede, clave_sede,
>           soporte.nombre_es as nombre_soporte, clave_soporte,
>           area_materiales.nombre_es as nombre_area_materiales,
> clave_area_materia
>           autor,
>           titulo,
>           descripcion,
>           fecha_intro, fecha_modificacion
>
>       from material, sede, soporte, area_materiales
>
>       where (material.clave_sede = sede.clave)
>           and (material.clave_soporte = soporte.clave)
>           and (material.clave_area_materiales = area_materiales.clave)
>           and (material.clave=1);
>
> How can I measure SQL queries and views?
>
> Thanks.
>
>
>
>
>
> ---------------------------(end of broadcast)---------------------------
> TIP 6: Have you searched our list archives?
>
> http://archives.postgresql.org
>
>
>



--
Emmanuel SARACCO
Email: esaracco@noos.fr


pgsql-general by date:

Previous
From: John Clark Naldoza y Lopez
Date:
Subject: Re:
Next
From: Tom Lane
Date:
Subject: Re: User privileges