lazy evaluation in query?
DBAsupport.com Forums - Powered by vBulletin
Results 1 to 4 of 4

Thread: lazy evaluation in query?

  1. #1
    Join Date
    Apr 2002
    Posts
    17

    Post

    hi, i wonder if oracle uses "lazy/shortcut evaluation" for the where clauses?

    like in java expression:

    if (A || B)

    - evaluates A only if A is true
    - evaluates B only if A is false

    if (A && B)

    - evaluates B only if A is true

    --------------------------

    select 'X'
    from students
    where
    (last_name != 'A' or
    first_name = 'Mark') and
    (......... etc.........)

    --------------------------
    if student name is
    first_name = Mark
    last_name = B

    would statement first_name = 'Mark' get evaluated (and go straight to etc)?
    Thanks!

  2. #2
    Join Date
    Jun 2000
    Location
    Madrid, Spain
    Posts
    7,447
    I believe it does
    if have the book Oracle 8i complete references in the first 25 pages I think it explains about this

  3. #3
    Join Date
    Feb 2002
    Location
    Dallas , Texas
    Posts
    158
    Hi,

    Yes it does according to Oracle Docs.

    Take Care.

  4. #4
    Join Date
    May 2002
    Posts
    27

    Exclamation

    yeah it does the same

Posting Permissions

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



Click Here to Expand Forum to Full Width