Queries and views - Mailing list pgsql-general

From David Cana
Subject Queries and views
Date
Msg-id 003901c1563e$07296900$0864a8c0@cherrytel.com
Whole thread Raw
List pgsql-general
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.





pgsql-general by date:

Previous
From: "Jim Buttafuoco"
Date:
Subject: pg_views view doesn't work
Next
From: Tom Lane
Date:
Subject: Re: FTI Queries and Explain