SQL optimization should be adjusted from five aspects:1. Remove unnecessary full table scans for large tables2. cache full table scan for small tables3. Verify the use of optimized Indexes4. Verify the optimized Connection Technology5. minimize the
optimization Problems of databasefirst, the question of the proposedIn the early stage of application system development, due to less development database data, the query SQL statement, complex view of the writing of the performance of the SQL
See a very comprehensive SQL optimization article, in the development of the work often do not consider the performance of the lack of (at the beginning of the data volume is not seen the difference in speed). But the more you write, the more you
See a very comprehensive SQL optimization article, in the development of the work often do not consider the performance of the lack of (at the beginning of the data volume is not seen the difference in speed). But the more you write, the more you
Analyze and compare execution time plan reads1. View execution time and CPUSET STATISTICS Time Onselect * from Bus_devhistorydataset statistics time offYou can see it in the message after execution.2. View the operation of the query for I/OSET
Analyze and compare execution time plan reads1. View execution time and CPUSET STATISTICS Time Onselect * from Bus_devhistorydataset statistics time offYou can see it in the message after execution.2. View the operation of the query for I/OSET
First, the Database design optimization1. Do not use cursors.Using cursors not only takes up memory, but also locks tables in incredible ways, so that all the performance optimizations that DBAs can do are equal to not being done. Each fetch in the
1. View execution time and CPUSET STATISTICS Time Onselect * from Bus_devhistorydataset statistics time offYou can see it in the message after execution.2. View the operation of the query for I/OSET STATISTICS IO onselect * from
In the early stage of application system development, due to less development database data, the query SQL statement, complex view of the writing of the performance of the SQL statement is not good or bad, but if the application system submitted to
1. To optimize the query, to avoid full table scanning, first consider the where and order by the columns involved in the index.2. Avoid null-valued fields in the WHERE clause, which will cause the engine to discard full-table scans using the index,
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.