are very readable6. Use where to replace having (if possible)Optimize GROUP BY:Increase the efficiency of the group BY statement by filtering out unwanted records before group by. The following two queries return the same result but the second one is significantly faster. Copy the code code as follows: Low efficiency:SELECT JOB, AVG (SAL)From EMP GROUP job has job = ' president ' and AVG (SAL) >xxxEfficient:SELECT JOB, AVG (SAL)From EMPWHERE JOB = ' President 'OR job = ' MANAGER ' GROUP JOB hav
fromV$thread T, V$parameter vWHEREV.name= 'Thread' and(V.value= 0 ORt.thread#=To_number (v.value))) I, (SELECTVALUE fromV$parameterWHERENAME= 'user_dump_dest') D;3.2 Using the Tkprof command to beautify the generated trace fileHere is what I often use, for more detailed instructions on the tkprof command, you can see the tkprof command directly enter.Tkprof xxx.trc xxx.txt Explain=system/Oracle sys=nReference URL: http://www.eygle
of data ... God horse is not as good as Oracle ...!!!There are some children's shoes simply think that SQL Server is pediatrics, there is no technical content ... It's very simple.On these points, I don't want to spit out anything, I just want to let those friends who really know SQL Server to prove something to SQL S
In order to be successful, I'll involve some preliminary steps that will be needed to see what happens, including running Plustrce SQL scripts, creating a Explain_plan table, granting roles, configuring Sql*plus environments to view execution plans. All of these steps include "use automatic tracking in Sql*plus" In Oracle
large print segments18.count (*) is slightly faster than count (1), of course, if you can retrieve by index, the count of indexed columns is still the fastest. 19. Replace the HAVING clause with a WHERE clause to avoid having a HAVING clause, having The result set is filtered only after all records have been retrieved19. Avoid using like ' * ' to avoid using is null or20.Note:A, programmers pay attention to the amount of data in each table.B, the coding process and the unit test process as far
Tags: des style blog http color using strong AR dataBackgroundMySQL and Oracle were used before, and there was not much use for SQL Server. Recently, due to project reasons, to read the database of other projects, take out a gate of the switch history, and the other side of the use of SQL Server, so the study of SQL Se
--=======================================
--The adjustment and optimization of shared pool (Sharedpool tuning)
--=======================================
Shared pool is the most critical memory fragment in the SGA, which consists primarily of the library cache (shared SQL and Pl/sql) and the data dictionary cache. Where the function of the library cache is to sav
high selectivity and few tuples to narrow the intermediate result.3. When loading data heavily, do not use INSERT statementsCurrently, each DBMS provides a response loading tool, for example, Sql*loader in Oracle, which has the following characteristics:(1) Skip the DBMS query processing system, directly in the page, the transfer to the database storage System.(2) Do not leave the front, post-like record.(
ConclusionThis article first to this bar, short, easy to understand, this article mainly introduces the query plan of the joint operators, the next we analyze SQL Server parallel operations, in multicore hyper-threading gathered today, see SQL How server uses parallel operations to maximize the use of existing hardware resources to improve performance, is interested in advance attention, the content o
. Step 4, repeat Step 3 until an empty set is returned. Step 5 returns the result set and merges R0 to Rn through union all. Readers familiar with programming know That recursive programming is highly efficient. Similarly, after the CTE uses recursion, data insertion will become quite high. From the data file growth rate, we can see that the data file growth before the CTE increases at a speed of several K per second, after CTE is used, data files increase at a rate of nearly 2 MB per second. Af
Oracle is a high-performance database software. The user can adjust the parameters to achieve the optimization of performance. Performance optimization is mainly divided into two parts:
First, the database administrator through the adjustment of system parameters to achieve the goal of optimization;
The second is that the developer achieves the adjustment by optimizing the application.
Here, only the tuning
types of SQL statements that need to be used to increase the free space in the data block: The DELETE statement, and the UPDATE statement that updates the existing data value to a smaller size. In the following two conditions, the space freed by the above two operations can be used by subsequent INSERT statements:If the INSERT statement is in the same transaction as the above two operations (transaction) and is located after the statement that freed
Run Select Dbms_sqltune.report_tuning_task (: tuning_task) from dual; Error messages, such as the following:Ora-00600:internal error code, arguments: [Kesqsmakebindvalue:obj], [], [],[], [], [], [], []Ora-06512:at "SYS. Prvt_advisor ", line 1624Ora-06512:at "SYS. Dbms_advisor ", line 186Ora-06512:at "SYS. Dbms_sqltune ", line 1008Ora-06512:at Line 8##################Confirmed by MoS, this is a bug. Need to upgrade to 10.2.0.5PSU or 11.2Article:Tuning Advisor terminates with Ora-600[kesqsmakebind
Tags: style blog ar color OS using SP strong onFirst, memory adjustmentOracle 11g, Oracle unified the SGA with the PGA, the sum of the Memory_target parameter settings, that is, Max (SGA+PGA) Alter system set sga_max_size=1500m Scope=spfile;If the error is set to Sga_max_size>=memory_target (not equal, the PGA requires at least approximately more than 10 m of memory), the startup Nomount cannot be performed, but modifying the SGA command requires at l
, Microseconds_per_second ms_per_sec, pct_of_time pct from Opsg_delta_report where Microseconds_per_second > 0; Monitoring the usage of indexes: With In_plan_objects as(SELECT DISTINCT object_name from V$sql_plan WHERE object_owner = ' SCOTT ')SELECT table_name,Index_name,CaseWhen object_name was NULL then' NO 'ELSE' YES 'END as In_cached_planFrom User_indexesLeft OUTER JOIN in_plan_objectsOn (index_name = object_name);4. Identify the SQL st
Tags: merging RDBMS LTE data file nbsp Select line div2016-11-22Subquery: Scalar subquery inline view (In-line views) semi-join/reverse-connect scalar subquery Select followed by subquery similar to a custom function to overwrite an inline view (In-line view) from followed by a subquery similar to Design view sub-query A condom query is a garbage design that can cause performance problems. A semi-connection is a subquery that has a in/exists in the back of where it is followed by a subquery with
rownumObviously, this writing will result in reading the table first, then sorting, and then taking the first 5 records, the plan is as follows:If we write like this, the semantics are the same, but it saves a lot of reading and sorting costs:Select/*+ Index (T1,IDX1_T1) */* from T1 where rownumThe execution plan for this SQL is as follows:As you can see, the SQL does not follow the hint instructions and s
SQL Server database self-optimizing release time under large data volume:2013-12-17 15:19:00 Source: Forum anonymous Keywords: database development1.1: Add secondary data filesStarting with SQL SERVER 2005, the database does not generate the NDF data file by default, generally there is a master data file (MDF) is enough, but some large databases, because of a lot of information, and query frequently, so in
Tags: exact int user number login insert share only blur executionIntroducedOften people ask how the profile tool should be used? There is no way to get a poor performance SQL problem. Since I turned to MySQL myself for almost 2 years without using profile, suddenly profile became a little rusty and had to be re-acquainted. This article mainly provides a detailed introduction to the profile tool, including the use of tools and how to do so. Profile is
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.