Learn how to a build a cloud-first strategyRegister Now

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 276
  • Last Modified:

Which sql query would go faster?

select * from table where number = '1' and insert_date > sysdate -1
or
select * from table where insert_date > sysdate -1 and number = '1'
0
jjc_mn
Asked:
jjc_mn
2 Solutions
 
slightwv (䄆 Netminder) Commented:
No difference.

Generate the execution plans to verify they are the same.
0
 
ajexpertCommented:
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
0
 
jjc_mnAuthor Commented:
Thanks
0
 
gselvanCommented:
Both are using  same where  , but it depens on your size of table
0
 
slightwv (䄆 Netminder) Commented:
>>but it depens on your size of table

In Oracle?
0

Featured Post

 [eBook] Windows Nano Server

Download this FREE eBook and learn all you need to get started with Windows Nano Server, including deployment options, remote management
and troubleshooting tips and tricks

Tackle projects and never again get stuck behind a technical roadblock.
Join Now