Label:1. Top10sql "with the most execution times"DB2 "SELECT * from Sysibmadm.snapdyn_sql ORDER BY num_executions DESC FETCH first ten rows only"2, the average execution time the longest Top10sql "DB2 "SELECT * from Sysibmadm.top_dynamic_sql ORDER BY average_execution_time_s DESC FETCH first ten rows only"3, the most ranked Top10sql "DB2 "SELECT * from Sysibmadm.
One of the practical skills that can greatly improve the performance of SQL TUNING optimization.
When we perform SQL optimization, we often encounter the need to sort a large number of datasets and then retrieve the first part of the results from the sorted set. In this case, when we write
Label:Original: T-SQL performance Tuning-information collectionIO information (starting from server startup)--database IO Analysiswith iofordatabase as (SELECT db_name (vfs.database_id) as DatabaseName, case if Smf.type = 1 Then ' log_file ' ELSE ' data_file ' END As Databasefile_type, sum (vfs.num_of_bytes_written) as Io_write, sum (VFS.N
/1000 N ' Total time spent in MS ',total_worker_time/1000 N ' Total CPU time MS ',Total_physical_reads N ' Total number of physical reads ',Total_logical_reads/execution_count N ' Each logical read ',Total_logical_reads N ' Logical reads total number of times ',Total number of total_logical_writes N ' logical writes ',Execution_count N ' execution times ',Creation_time N ' statement compilation Time ',Last_execution_time N ' Last Execution time ',SUBSTRING (St.text, (QS.STATEMENT_START_OFFSET/2)
summary data is based is updated frequently, it is easier to use a view than to write SQL every time
2. Create a ViewThis is how the CREATE view is defined in the MySQL documentation: CREATE [OR REPLACE] [algorithm = {UNDEFINED | MERGE | TempTable}] [definer = {User | Current_User}] [SQL SECURITY {definer | INVOKER}]VIEW view_name [(column_list)]As Select_statement[With [cascaded | LOCAL] CHECK
Microsoft, one is not perfect function also dare to take Out (2000) The second functional architecture of the outstanding design makes the function has a strong continuity and Scalability (2005 2000 of the function to retain and improve).
The optimization tool is simple to use
1: Use SQL Server Porfiler (Event Viewer) to record all the steps of the operation database in the business system and save it as a working file.
2: Open sql2005 's database
Tags: Profiler Performance Performance Analyzer tuning performance calibrationSQL Server Profiler-performance tuningPerformance has enough reason to become a hot topic. Today's business is fiercely competitive, and if users think that an application is too slow, they will im
1. Import the trace file into the tableSELECT IDENTITY (BIGINT11 as RowNumber,* into TableNamefrom fn_trace_gettable ('trace.trc'default)2. Querying for statements with large CPU overheadSELECT Top -Total_worker_time/Execution_count asAvg_cpu_cost, Plan_handle, Execution_count, (SELECT SUBSTRING(text, Statement_start_offset/2 + 1, ( Case whenStatement_end_offset= -1 Then LEN(CONVERT(nvarchar(Max),text))* 2 ELSEStatement_end_offsetEND -Statement_start_offset)/2) fro
Brief introduction
DB2 for I5/os on V5R4 provides new ways to improve the performance of database queries through some popular dynamic SQL interfaces. The SQL call Level Interface (CLI) provides a new connection property for the user to tune the optimization target used by the database query. The Java Database connect
rows reserved data index_size unused
TB_WCB 9439661 317208 kb 167168 KB 149872 KB 168 KB
*/ we found that the size before index compression was 329M. And after compression is 149M, the compression ratio is 45%. The effect is also very obvious. Summarize: Compression through tables and indexes. We can reduce the disk space occupied by the table, this is only part of it, and more importantly, reading the same amount of data, just need to read less data pages,
compression is 167M, the size of the table after compression is only 40% of the original table, the effect is obvious, and because most of the table's fields are only IDs, the relative repetition value is not too much.However, we see that the size of the index varies substantially, so we continue to compress the index:5. Compression indexAlter index idx_tb_wcb_id on Tb_wcbrebuildwith (Data_compression=row)6, the comparison after the index compressionsp_spaceused ' ms_visit_qst_opt '/*name
Create a role tableCREATE TABLE Nbctxp. Tbl_nbc_nonbankrole (ID BIGINT not NULL,ROLENAME VARCHAR (50),Createtime TIMESTAMP,UpdateTime TIMESTAMP,CONSTRAINT p_id PRIMARY KEY (ID));CREATE INDEX SQL150130091455900 on NBCTXP. Tbl_nbc_nonbankrole (ID);Let the primary key increment by 1Alter table Nbctxp. Tbl_nbc_nonbankrole ALTER column ID set generated always as identity (start with 1,increment by 1)Create an intermediate table of role tables and user tablesCREATE TABLE Nbctxp. Tbl_nbc_nonbankur (USE
increasing number of users and data volumes. Scalability is limited. Oracle
Parallel servers extend the capabilities of Windows NT by enabling a set of nodes to share work in the same cluster, providing high-availability and highly scalable clusters of solutions. If WindowsNT does not meet the needs, users can move the database to UNIX.
DB2
DB2 has a good parallelism. The
Tags: process optimizer consolidation requires merging auto overwrite session accessThe full execution order of the SELECT statement:The full execution order of the SQL SELECT statement: 1. The FROM clause assembles data from different data sources; 2. The WHERE clause filters the record rows based on the specified criteria, 3, the GROUP BY clause divides the data into multiple groupings, 4, uses the aggregation function for the calculation, 5, uses t
be sorted, or it can be added to a column (like joins or additions). Any non-indexed item in the ORDER BY statement, or a computed expression, will slow down the query. Double-check the order BY statement to find non-indexed items or expressions that degrade performance. The solution to this problem is to rewrite the order BY statement to use the index, or you can establish another index for the column you are using, and you should absolutely avoid u
union and UnionAll. UnionAll Good 18, pay attention to using distinct, do not use when not necessary, it will make the query slower than the union. Duplicate records are not a problem in the query. 19. Do not return rows or columns that are not required when querying 20. Use sp_configure ' query governor cost limit ' or setquery_governor_cost_limit to limit the resources consumed by the query. When an estimate query consumes more resources than the limit, the server automatically cancels the qu
index, the TPS from the previous 110 to 6000 such. Two. The SQL statement index does not work: When performing a performance test, the server is running under the circumstances:
The CPU of the database is up to 90%-99.9%, and the CPU of the application is low;
Sufficient memory (free memory >20m);
Network normal;
Disk input/output is normal;
CPU-High Monitor diagram The logs a
Label:Original address: Http://social.technet.microsoft.com/wiki/contents/articles/4995.sql-server-columnstore-performance-tuning.aspxSQL Server's Columnstore index is a new version of SQL Server release that improves query performance for the Data Warehouse, and this article explains the
an execution plan, and stored in a database of SQL statements, is a collection of control flow language, the speed of course fast. 48, the return value of the function is not too large, this overhead is very large. A user-defined function that executes as a cursor consumes a large amount of resources if a large result is returned with a stored procedure. 49, as far as possible to avoid repeated access to the same or several tables, especially the lar
released, the data page will not be in the memory of the data cache, This causes the memory problem to be the bottleneck of the disk. PAGEIOLATCH_EX is write data, this is generally the disk write speed obviously keep up, and memory is not directly related. Here is the resource wait time for query pageiolatch_x: Select Wait_type,
waiting_tasks_count,
Wait_time_ms,
Max_wait_time_ms,
Signal_wait_time_ms
from sys.dm_os_wait_stats
wherelike' pageiolatch%'
order by Wait_type Through the above
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.