Oracle paging statements and Performance

Source: Internet
Author: User

The Oracle paging statement and the olts_trade.trd_item table have a total of 1665 pieces of data. SQL developer is used for performance analysis (explain Plan ). ------------------------------------------ SQL code select * from (select rownum rn, t. * from (select itm. * from OLTS_TRADE.trd_item itm) t where rownum <= 100) t1 where t1.rn> = 90; cost = 11315 go through the full table scan explain SQL code select itm1. * from (select rownum rn, t. n_id from (select itm. n_id from OLTS_TRADE.trd_item itm) t where rownum <= 100) t1 inner join OLTS_TRADE.trd_item itm1 on t1.n _ id = itm1.n _ id where t1.rn> = 90; the above n_id is the primary key cost = 171 using the primary key index explain SQL code select * from olts_trade.trd_item where n_id in (select n_id from (select rownum _, n_id from (select n_ID from olts_trade.trd_item) where rownum <= 100) where rownum _> = 90) cost = 172 used in --------------------------------------------

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.