Results 1 to 3 of 3

Thread: performance?

  1. #1
    Join Date
    Nov 2003
    Posts
    10

    Unanswered: performance?

    hi

    Is any difference between the following query's in performance point of view.

    1. select * from sal_master where status='D' and deliverydate='02-jun-04';

    2. select * from sal_master where deliverydate='02-jun-04' and status='D';

    the above two querys are same,but order in the where condition is difference.


    bye

  2. #2
    Join Date
    Mar 2002
    Location
    Reading, UK
    Posts
    1,137
    There shouldnt be any difference unless youve come across some obsuce bug in the optimizer. But why ask anyway try it out yourself and look at the explain plan.

    Alan

  3. #3
    Join Date
    Sep 2002
    Location
    UK
    Posts
    5,171
    Provided Answers: 1
    In the bad old days the RBO used to be affected by the order of predicates in the WHERE clause - and, even more dramatically, by the order of tables in the FROM clause. But you will be using the CBO of course, where no such effects exist.

    However, both your queries contain a potential bug:

    This: deliverydate='02-jun-04'

    Should be: deliverydate=to_date('02-jun-2004','dd-mon-yyyy')

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •