sql - How could predicate pushing on an inline view slow down a query? -


I have found a somewhat disturbing query that I am working on refactoring for rendering.

During this process, whatever I did because of personal preference, the syntax included in ANSI-99 was done to predict the query from the "internal connecting" and "left external connect" statement. . I saw two very strange things on which I appreciate the explanation.

  1. The syntax has changed the lecture plan to join "inner join ..." with the ANSI 99 syntax, Oracle scanned the entire table on the columns which were adding. After changing the syntax to add, it is now push push emphasis. Why does the plan to understand change?
  2. Predicting the inline footage has actually slowed the query by a very important margin. Query running at about 3 seconds (before changing pair) Now it is taking 9 seconds to be honest For, I'm new enough to explain plans, it is entirely possible that the restructuring of the query has slowed it for some other reason but eventually my The question is: "Is it possible to slow down a query to push the indicator column? If so, why?"

Thanks for the reply, and my apologies if this is not very clear ...

Is it possible to slow down a query possibly to push the column of the indicator? If so, why?

It is certain that.

As a rule, push the device to the adapter nested loops code> hash join .

This can be slow if the condition is not selected.

This query

  from SELECT * table1, T1 (SELECT / * + NO_PUSH_PRED * / * FROM table2 t2 WHERE t2.col1 =: value1) T2O WHERE T2o.col2 = t1.col2  

Most likely a hash table will be created by the view against the contents of table1 and this hash table (or vice versa) Check the rows of rows.

This query:

  SELECT * table1, t1 (SELECT / * + PUSH_PRED * / * FROM table2 t2 WHERE t2.col1 =: value1) T2O WHERE t2o Select an index from  tip loop  and  (t2.col1, t2.col2) from .col2 = t1.col2  

if is scheduled.

The latter is more efficient if selective on col2 selective table2 , and less efficient if it is not.

My educated guess is what's really going on in your case.

If you post your questions and execution plans, then I will probably be able to tell more.


Comments

Popular posts from this blog

c++ - Linux and clipboard -

What is expire header and how to achive them in ASP.NET and PHP? -

sql server - How can I determine which of my SQL 2005 statistics are unused? -