Using the query INTERSECTion - Mailing list pgsql-general

From Vincenzo Romano
Subject Using the query INTERSECTion
Date
Msg-id 200706181610.41688.vincenzo.romano@gmail.com
Whole thread Raw
Responses Re: Using the query INTERSECTion
List pgsql-general
Hello everyone.

In order to build some dynamic queries (EXECUTE under PL/PgSQL)
I'm taking in consideration to use the INTERSECT operator in order
to split a WHERE-condition in a static one and a dynamic one to be
built at runtime.

Instead of

SELECT * FROM joinedtables WHERE static_cond AND dynamic_cond;

I could use:

SELECT * FROM joinedtables WHERE static_cond
  INTERSECT
SELECT * FROM joinedtables WHERE dynamic_cond

I'm wondering what'd be the difference in efficiency between these
two queries.

Is there any advise?

Many thanks in advance.

--
Vincenzo Romano
--
Maybe Computer will never become as intelligent as Humans.
For sure they won't ever become so stupid. [VR-1988]

pgsql-general by date:

Previous
From: "A. Kretschmer"
Date:
Subject: Re: Loop through all views with PHP
Next
From: Francisco Reyes
Date:
Subject: Re: Command line export or copy utility?