Subject Re: [firebird-support] Re: To JOIN or not to JOIN that is the question
Author Helen Borrie
At 05:18 PM 15/06/2009, you wrote:
>Hi Alexandre
>
>Thanks for your quick response. Please correct me where I am wrong. My understanding of the WHERE clause is that it is client side filter or atleast it applies the filter after the dataset is created, sort of a step 2. So is it (as per my understanding) be efficient because it will create a set and then remove records, when I did not want the records in the first place.

Wrong. A WHERE clause is applied during the search for eligible records. The server has no idea about a "client side filter".

>Will what I have done (however unusual :)) have a bad effect on the performance of the query or load the server unnecessary?

Yes. NOT queries are inefficient. Period.

>I am open to do what you suggested but just want to clarify my understanding of what I have done.

There are other things about your query that are inefficient. You are joining on non-indexed columns (which makes a difference in cases where an index could be used if one were available); and converting regular column outputs to expression fields unnecessarily is another slowdown.

./heLen