Suppose my select query has cost 100 and I have another way in which i am writing two queries which has cost (40 + 60). Both have same cost ultimately.
I want to know what is the most effective way.
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
ignore cost. its not the starting place for tuning, its just an internal ranking used by Oracle to pick the best plan for a given SQL statement. Cost can never be used to compare two different SQL statements to determine which one is better; i.e you can have a query with very high cost that is faster and uses less resources than a query that has a low cost.
if the query is as fast as splitting it in two, then leave it as one SQL (1 less round trip to do).