Which sql query would go faster?

Posted on 2011-10-13
Last Modified: 2012-05-12
select * from table where number = '1' and insert_date > sysdate -1
select * from table where insert_date > sysdate -1 and number = '1'
Question by:jjc_mn
    LVL 76

    Accepted Solution

    No difference.

    Generate the execution plans to verify they are the same.
    LVL 14

    Assisted Solution

    Did you check the explain plain?

    From oracle 10g and above, if table stats are up to date, where condition order does not matter

    Hope it helps

    Author Closing Comment


    Expert Comment

    Both are using  same where  , but it depens on your size of table
    LVL 76

    Expert Comment

    by:slightwv (䄆 Netminder)
    >>but it depens on your size of table

    In Oracle?

    Write Comment

    Please enter a first name

    Please enter a last name

    We will never share this with anyone.

    Featured Post

    Looking for New Ways to Advertise?

    Engage with tech pros in our community with native advertising, as a Vendor Expert, and more.

    Why doesn't the Oracle optimizer use my index? Querying too much data Most Oracle developers know that an index is useful when you can use it to restrict your result set to a small number of the total rows in a table. So, the obvious side…
    Truncate is a DDL Command where as Delete is a DML Command. Both will delete data from table, but what is the difference between these below statements truncate table <table_name> ?? delete from <table_name> ?? The first command cannot be …
    This video shows, step by step, how to configure Oracle Heterogeneous Services via the Generic Gateway Agent in order to make a connection from an Oracle session and access a remote SQL Server database table.
    Video by: Steve
    Using examples as well as descriptions, step through each of the common simple join types, explaining differences in syntax, differences in expected outputs and showing how the queries run along with the actual outputs based upon a simple set of dem…

    794 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    17 Experts available now in Live!

    Get 1:1 Help Now