I. Introduction of the Platform environmentSystem: Win7 64-bitDevelopment tools: vs +oracle 11Project: ASP. NET Web ApplicationDeployment: IIS Local Application Mode Ii. Description of the problemThrow exception when opening database connection
There are two simple examples to illustrate the efficiency issues of "exists" and "in"1) SELECT * from T1 where exists (select 1 from T2 where t1.a=t2.a);When the T1 data volume is small and the T2 data is very large, the query efficiency of T12)
method One: by To_number function exception to judgeCREATE OR REPLACE FUNCTION is_number (Str_ VARCHAR2) RETURN VARCHAR2IsNUM_ number;BEGINNum_: = To_number (STR_);RETURN ' Y ';EXCEPTIONWhen OTHERS ThenRETURN ' N ';END Is_number;/Sql> Select
Today, when we suddenly recall Oracle's paging query, most of the cases are used:SELECT * FROM(SELECT a.*, ROWNUM RNFrom (SELECT * from table_name) AWHERE ROWNUM )WHERE RN >= 21Said to be efficient, but for the SELECT * FROM table_name This original
The following SQL execution time is decremented by ordinal.1, dynamic SQL, no bound variables, each execution of a hard parse operation, occupy a large pool space, if the pool space is insufficient, the other SQL statements will cause the resolution
When you import/create an Oracle database table, sometimes we examine the discovery, import/create table, and the table space created is not the default table space we want. At this point we need to modify the user's default tablespace and then
- ---------------------Here is the query numeric field value/ *declarecursor cur_query is select table_name, column_ Name, data_type from User_tab_columns; a number; Sql_hard varchar2 (+); VV Number;begin for rec1 in Cur_query loop a:=0; If
1. An update and delete can kill a large chunk of people because everyone thinks this sentence is very well written, not just:Update table set a=x,b=y;Delete from table where name=xxOf course, now I talk about this problem, we certainly disagree, so
to put it simply, Oracle takes random numbers, mostly by calling Dbms_random packets, and there are roughly 4 ways to generate random numbers by Dbms_random packets: 1, Dbms_random.normalThis function does not take arguments, and is used to produce
Dynamic SQL (learning notes) and dynamic SQL learning notes
Dynamic SQL
Execute immediate dynamic SQL string [BUCK COLLECT] INTO custom variable, | record type
USING [IN | OUT | in out] bound parameters]
[RETURNING | RETURN] [bulk collect] INTO
Set Operations of data (learning notes) and computing learning notes
A set operation is a binary operator.
A total of four operators, and, difference, intersection, Cartesian Product
Set operation Syntax:
Query statement [UNION | union all |
Conversion Function (learning notes), conversion function learning notes
-- ****************************** Conversion Function-- Format the current date and time
Select sysdate, to_char (SYSDATE, 'yyyy-MM-DD hh24: mi: ss') format date, to_char
General functions (learning notes), general function learning notes
-- **************** Common functions-- NVL processing NULL-- NVL (number | column, default value). If the displayed number is NULL, the default value is used.-- NVL2 (number |
Database Connection (study notes) and Database Study Notes
After Oracle is installed, several additional services will be added to the service.
Since Oracle consumes system resources, we recommend that you change the service type to manual. You can
Oracle Performance Optimization Operation 14: using function-based indexes
As mentioned above, any operations on columns may cause full table scanning. For example:
select * from emp where substr (ename, 1, 2) = 'sm ';
However, this type of
PLSQL _ performance optimization Series 1 _ concepts and importance of statistics (concepts) and plsql Performance Optimization
2014-12-18 Created By BaoXinjian
I. Summary
Statistic is very important to Oracle.
It collects detailed information
Oralce time conversion usage TO_CHAR (DATE, FORMAT)
1. This week, this month, and this year
-- This week select trunc (sysdate, 'D') + 1 from dual; -- Monday select trunc (sysdate, 'D') + 7 from dual; -- Sunday -- select trunc (sysdate, 'mm') from
Oracle Performance Optimization Operation 9: shielding useless Indexes
Example of "oracle performance optimization operation 8"
In actual queries, there are also queries involving DisposalCourseFlag = 6. If the index on this field is used, it is
Oracle Performance Optimization Operation 7: Index improves query efficiency when data distribution is uneven
Index selection is low, but the data value distribution is very different, you can still use the index to improve efficiency.
A. In
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