This article describes the concepts and operations of Partitioned Tables from the following aspects:1. Concepts of tablespaces and partition tables2. Specific functions of table partitions3. Advantages and Disadvantages of table partitions4. Table partition types and operation methods5. maintenance operations on table partitions.(1) concepts of tablespaces and partition tablesTablespace:Is a collection of one or more data files. All data objects are stored in the specified tablespace, but they a
1: When performing multi-table join, use the Where statement to minimize the result set of a single table. Use the aggregate function to summarize the result set and associate it with other tables to minimize the data volume of the result set.2: When two tables are joined, you should consider whether to use right join. To increase the query speed3: Use where instead of havingWhere is used to filter rows, while having is used to filter groups, because
1: When performing multi-table join, use the Where statement to minimize the result set of a single table. Use the aggregate function to summarize the result set and associate it with other tables to minimize the data volume of the result set.2: When two tables are joined, you should consider whether to use right join. To increase the query speed3: Use where instead of havingWhere is used to filter rows, while having is used to filter groups, because
records, allowing subsequent conditional processing to handle as few records as possible) 3. Avoid using "*" in the SELECT clause During the parsing process, Oracle converts * once to all column names, which is done by querying the data dictionary, which means more time is spent 4, reduce the number of access to the database Oracle has done a lot of work internally: Parsing
voodoo magic. SELECT B.sid, b.serial#, A.spid ProcessID, b.process clientpid from V$process A, v$session bwhere A.add R = b.paddr and B.audsid = USERENV (' SessionID '); V$session. SID and V$session. serial# is the database process ID V$process. SPID is the database server background process ID V$session. Process is the client process ID, On Windows it is:separated the first # was the PROCESS ID on the client and 2nd the the THREAD ID. 32. Query
part.
Therefore, if the character set between the two databases is the same as that in the third part, data can be imported and exported to each other. The preceding information is only prompted in Chinese or English.
2. view database character sets
This involves three character sets,
The first is the character set of the kernel El server;
The second is the character set of the Oracle client;
The third is the DMP file character set.
During data impor
Tags: Oracle SQL performance optimizationConcept: Sub-query unwrapping (subquery unnesting) is an optimization of the target SQL that the optimizer handles for the band query, which means that the optimizer no longer treats the target SQ
$ sqlarea QWhere S. paddr = P. ADDRAndS. Sid = PAndS. SQL _address = Q. address;Query Based on the SID determined by the previous SQL statement.
Result:
Oracle and CPU resources
The Oracle Database shares CPU resources with all other software running on the same serve
second, need to stitch SQL statementsPaging Scenario Three: (using SQL Cursor stored procedure paging) is the least efficient, but most versatile
Third, Oracle paged query
Method One:
SELECT *
from (select A.*, rownum rn to
(SELECT * from tab) A
where rownum
This paging has less execution time
be processed first. When the FROM clause contains multiple tables, you must select a table with the least number of records as the base table. If there are more than three tables for join query, You need to select the cross table (interp table) as the basic table, the cross table is the table referenced by other tables.
(2) join order in the WHERE clause.: ORACLE uses the bottom-up sequence to parse the WH
condition in Statement 7 after the on clause.Select O. ID, O. order_number, O. customer_id, C. ID, C. NameFrom orders o left Outer Join MERs C on C. ID = O. customer_id and O. order_number
The query results of statement 7 and statement 8 are obviously different, and the results displayed in Statement 8 are hard to understand. Therefore, when writing a join query, we recommend that you only follow the join
" for the [Html]
The program is the same as above.Pay attention to the following issues when calling stored procedures:To use stored procedures in Hibernate, you must follow some rules. stored procedures that do not follow these rules will be unavailable. if you still want to use them, you must pass the session. connection () to execute them. these rules apply to different databases. because database providers have different stored procedure syntax and semantics.You cannot use setFirstResult ()/
Oracle paging query tutorial and oracle paging tutorial
SELECT *
FROM (select rownum as rowno, t .*
FROM table t where rownum
Page with order by statement: SELECT *
FROM (select rownum as rowno, r .*
FROM (SELECT * FROM table t
Order by t. element asc
) R
Where ROWNUM
) Table_alias
WHERE table_alias.rowno> (page-1) * size;
The upper limit condition
A common method to improve the efficiency of SQL query(1) Select the most efficient table name order (valid only in the rule-based optimizer):The Oracle parser processes the table names in the FROM clause in a right-to-left order, and the FROM clause is written in the final table (the underlying table, driving tables) will be processed first, and in the case wher
"annual Salary"From EMP ORDER by 3 DESC;SELECT ename,job,sal from emp ORDER by Job,sal DESC;SELECT ename,job,sal from emp ORDER by Empno;Modify Default display widthSET line[size] {80|n}SET Line 100L display the SQL statement in the buffer you just enteredN Text modified section of error'/' (run) commandSAVEGET@ or Start command when the specified script file contents are loaded into the SQL buffer to runS
optimize some SQL statements ).My learning method:1. I have read at least 5000 articles on metalink, so I am still sensitive to the problem.2. This is based on the fact that I am familiar with Oracle databases, and metalink and DSI are very helpful to me, with the basis of metalink and DSI, there are some problems that I can be confident in the simulation process.3. BBED is just a tool. The key to making g
The previous examples demonstrate the performance improvement caused by the standard writing of paging query statements.
Here, we will briefly describe when paging query statements cannot improve performance.
The paging query statement can return results quickly because it aims to return the first result as quickly as possible. If there are 20 records on each
I. Operator Optimization
1. In Operator
SQL statements written in are easy to write and understand, which is suitable for modern software development. However, SQL statements using in always have low performance. The following differences exist between SQL statements using in and SQL statements without in:
Oracle learning notes 3 SQL commands, oracle learning notes SQLSQL introduction SQL supports the following types of commands: 1. data Definition Language (DDL) 2. data manipulation language (DML) 3. transaction Control Language (TCL) 4. the Data Control Language (DCL) is a detailed note of the four
/* Use ms SQL to implement the T-SQL code for Distributed Query of heterogeneous databases */
Exec sp_addrole server 'Ms _ SQL ', '', 'sqloledb', '2017. 18.9.20'Exec sp_add1_srvlogin 'Ms _ SQL ', 'false', null, 'sa', 'capec '/* Create a sqlserver remote connection to the sq
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.