Efficiency issues with Oracle query logging

Source: Internet
Author: User

The recent optimization of Oracle database efficiency, and then on the Internet to check the existence of a number of high-efficiency methods
There are a lot of suggestions on the Internet first method, I did a test, but probably not enough data volume, 42,667 Records, do not know what a large amount of data is a situation

Many highly efficient ways to advise online

SELECT * from item where item= ' 1b241371x0021 ' and rownum<2;

But the result of my test:

SELECT * from item where item= ' 1b241371x0021 ' and rownum<2;

1 rows selected in 0.047 seconds


COUNT (*) mode

Select COUNT (*) from item where item= ' 1b241371x0021 ';

1 rows selected in 0.016 seconds


Exists way

Select COUNT (*) from the dual where exists (select 1 from item where item= ' 1b241371x0021 ');

1 rows selected in 0.015 seconds


From the test results, the latter two methods are significantly more efficient than the previous one.

Efficiency issues with Oracle query logging

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.