The general paging method is like the following:The so-called "three-layer nesting" Statement),
SELECT*
FROM(SELECTa.*
,rownumrn
FROM(SELECT*FROMtable_name)a
WHERErownum
WHERErn>=21
Performance problems may occur when a record with more than 1 million rows in a data table is displayed. The solution proposed by someone is to use the index. First, scan the index to find the rowid, and then use the rowid to find the required records. What if there is no index? Taking
The general paging method is like the following (the so-called three-layer Nesting Method), SELECT * FROM (SELECTa. * nbs ..
The general paging method is like the following (the so-called three-layer Nesting Method), SELECT * FROM (SELECTa. * nbs ..
The general paging method is like the following (the so-called "three-layer nesting" method ),
When a record with 1 million rows in a data table is displayed, the U.S. server may have performance problems. The solution proposed by someone is t
Use this SQL statement
select * from tree
View the raw data as follows:
The following figure shows the result of a tree query (including the fields root, level, is_leaf, and Path ):
Execute the following SQL statement:
select connect_by_root(child_col) root, level , decode(connect_by_isleaf,0,'No',1,'Yes') is_leaf, sys_connect_by_path(child_col,'/') pathfrom treestart with parent_col is null connect by
intoTValues(i);8 Commit;9 EndLoop;Ten End; One /4. Batch commit.1 Create or Replace procedureproc_test2 as3 begin4 forIinch 1..1000005 Loop6 Insert intoTValues(i);7 EndLoop;8 Commit;--Batch Submission9 End;Ten /5. Write a SQL, which is inserted into a set concept by the original procedure, and a whole batch is written to the data buffer area.1 Insert into Select from by Level 1000000 ; 2 commit;6. Insert data in dir
=spno;End-----3. How to call in Java---1. Create CallableStatement CS =ct.preparecall ([Call Sp_pro9 (?,?)]);----Cs.setint (1,10);----Cs.registeroutparameter (2,oracle.jdbc.oracletypes.cursor);--run--cs.execute ();--Get the result set/*resultset rs= (ResultSet) Cs.getobject (2);while (Rs.next ()) {....}*/---------------------Exception Handling---------Case_not_foundData_not_foundCursor_already_openDup_val_on_index Unique index repeatedInvaild_cursor run operation on an illegal cursor for
In the AWR report, it was found that a SQL is inefficient:Select Batch_status from T_batch_infowhere batch_status= ' 0 'and sys_id= ' STM06 ';View execution Plan Discovery the query takes advantage of the index, which contains the Batch_status field, but with the following SQL query:Select Batch_status,count (*) from T_batch_infoGROUP BY Batch_statusThere are few values found for the Batch_status field:Batc
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.