主頁 > 資料庫 > MySQL8.0-INFORMATION_SCHEMA增強

MySQL8.0-INFORMATION_SCHEMA增強

2020-11-18 17:19:32 資料庫

導讀

作者:Gopal Shankar

翻譯:徐晨亮
原文地址: https://mysqlserverteam.com/mysql-8-0-improvements-to-information_schema/


Coinciding with the new native data dictionary in MySQL 8.0, we have made a number of useful enhancements to our INFORMATION_SCHEMA subsystem design in MySQL 8.0. In this post I will first go through our legacy implementation as it has stood since MySQL 5.1, and then cover what’s changed.
與MySQL 8.0原生資料字典一致,在MySQL 8.0的 INFORMATION_SCHEMA 子系統設計中,我們做了一些很有用的增強,在這篇文章中,我將會介紹自MySQL 5.1以來的舊的實作方式,然后介紹我們做了什么改變,
Background
INFORMATION_SCHEMA was first introduced into MySQL 5.0, as a standards compliant way of retrieving meta data from a running MySQL server. When we look at the history of INFORMATION_SCHEMA there have been a number of complaints about the performance of certain queries, particularly in the case that there are many database objects (schemas, tables etc).
INFORMATION_SCHEMA 首次引入MySQL 5.0,作為一種從正在運行的MySQL服務器檢索元資料的標準兼容方式,當我們回顧 INFORMATION_SCHEMA 的歷史時,對于某些特定查詢性能總是有很多的抱怨,特別是在有許多資料庫物件(schema,表等)的情況下,
In an effort to address these reported issues, since MySQL 5.1 we have made a number of performance optimizations to speed up the execution of INFORMATION_SCHEMA queries. The optimizations are described in the MySQL manual, and apply when the user provides an explicit schema name or table name in the query.
為了解決這些上報的問題,從MySQL 5.1開始,我們進行了許多性能優化來加快 INFORMATION_SCHEMA 查詢的執行速度,MySQL手冊 <鏈接1> 中描述了這些優化,當用戶在查詢中提供顯式schema名稱或表名時,將會應用這些,
Alas, despite these improvements INFORMATION_SCHEMA performance is still a major pain point for many of our users. The key reason behind these performance issues in the current INFORMATION_SCHEMA implementation is that INFORMATION_SCHEMA tables are implemented as temporary tables that are created on-the-fly during query execution. These temporary tables are populated via:


  1. Meta data from files, e.g. table definitions from .FRM files.
  2. Details from storage engines, e.g. dynamic table statistics.
  3. Data from global data structures in the MySQL server.


盡管有這些改進, INFORMATION_SCHEMA的 性能仍然是我們許多用戶的主要痛點,在當前 INFORMATION_SCHEMA 實作方式下產生的性能問題背后的關鍵原因是, INFORMATION_SCHEMA 表的查詢實作方式是在查詢執行期間創建臨時表,這些臨時表通過以下方式填充:


  1. 元資料來自檔案,例如:表定義來自FRM檔案
  2. 細節來自于存盤引擎,例如:動態表的統計資訊
  3. 來自MySQL server層中全域資料結構的資料



For a MySQL server having hundreds of database, each with hundreds of tables within them, the INFORMATION_SCHEMA query would end-up doing lot of I/O reading each individual FRM files from the file system. And it would also end-up using more CPU cycles in effort to open the table and prepare related in-memory data structures. It does attempt to use the MySQL server table cache (the system variable ‘ table_definition_cache ‘), however in large server instances it’s very rare to have a table cache that is large enough to accommodate all of these tables.
對于一個MySQL實體來說可能有上百個庫,每個庫又有上百張表, INFORMATION_SCHEMA 查詢最侄訓從檔案系統中讀取每個單獨的FRM檔案,造成很多I/O讀取, 并且最侄訓會消耗更多的CPU來打開表并準備相關的記憶體資料結構, 它確實嘗試使用MySQL server層的表快取(系統變數 table_definition_cache ),但是在大型實體中,很少有一個足夠大的表快取來容納所有的表,
One can easily face the above mentioned performance issue if the optimization is not used by the INFORMATION_SCHEMA query. For example, let us consider the two queries below
如果 INFORMATION_SCHEMA 查詢未使用優化,則可以很容易碰到上面的性能問題, 例如,讓我們考慮下面的兩個查詢



 
mysql > EXPLAIN SELECT TABLE_NAME FROM INFORMATION_SCHEMA. TABLES WHERE
-> TABLE_SCHEMA = 'test' AND TABLE_NAME = 't1'\G
*************************** 1. row ***************************
id: 1
select_type: SIMPLE
table: TABLES
partitions: NULL
type: ALL
possible_keys: NULL
key: TABLE_SCHEMA,TABLE_NAME
key_len: NULL
ref: NULL
rows: NULL
filtered: NULL
Extra: Using where; Skip_open_table; Scanned 0 databases
1 row in set, 1 warning ( 0. 00 sec)

mysql > EXPLAIN SELECT TABLE_NAME FROM INFORMATION_SCHEMA. TABLES WHERE
-> TABLE_SCHEMA like 'test%' AND TABLE_NAME like 't%'\G
*************************** 1. row ***************************
id: 1
select_type: SIMPLE
table: TABLES
partitions: NULL
type: ALL
possible_keys: NULL
key: NULL
key_len: NULL
ref: NULL
rows: NULL
filtered: NULL
Extra: Using where; Skip_open_table; Scanned all databases
1 row in set, 1 warning ( 0. 00 sec)


As we can see from the EXPLAIN output, we see that the former query would use the values provided in WHERE clause for the TABLE_SCHEMA and TABLE_NAME field as a key to read the desired FRM files from the file system. However, the latter query would end up reading all the FRM in the entire data directory, which is very costly and does not scale.
EXPLAIN 的輸出可以看到, 我們看到前一個查詢將使用 WHERE 子句中為 TABLE_SCHEMATABLE_NAME 欄位提供的值作為鍵,從檔案系統讀取所需 FRM 檔案, 但是,后一個查詢最終將讀取整個資料目錄中的所有 FRM ,這非常昂貴且無法擴展,

Changes in MySQL 8.0
One of the major changes in 8.0 is the introduction of a native data dictionary based on InnoDB. This change has enabled us to get rid of file-based metadata store ( FRM files) and also help MySQL to move towards supporting transactional DDL. For more details on introduction of data dictionary feature in 8.0 and its benefits, please look at Staale’s post here.
8.0中的一個主要變化是引入了基于InnoDB的資料字典,這一變化使我們能夠擺脫基于檔案的元資料存盤( FRM 檔案),并幫助MySQL轉向支持事務DDL,有關在8.0中引入資料字典功能及其優點的更多詳細資訊,請在此處查看Staale的文章 <鏈接2> ,
Now that the metadata of all database tables is stored in transactional data dictionary tables, it enables us to design an INFORMATION_SCHEMA table as a database VIEW over the data dictionary tables. This eliminates costs such as the creation of temporary tables for each INFORMATION_SCHEMA query during execution on-the-fly, and also scanning file-system directories to find FRM files. It is also now possible to utilize the full power of the MySQL optimizer to prepare better query execution plans using indexes on data dictionary tables.
既然所有資料庫表的元資料都存盤在事務資料字典表中,它使我們能夠將INFORMATION_SCHEMA表設計為資料字典表上的資料庫視圖 , 這消除了成本,例如在執行期間為每個 INFORMATION_SCHEMA 查詢創建臨時表,以及掃描檔案系統目錄以查找FRM檔案, 現在還可以利用MySQL優化器的全部功能,使用資料字典表上的索引來獲得更好的執行計劃,
The following diagram explains the difference in design in MySQL 5.7 and 8.0.
下面的圖解釋了MySQL 5.7和8.0設計上的區別
640?wx_fmt=jpeg
If we consider the above example under Background, we see that the optimizer plans to use indexes on data dictionary tables, in both the cases.
如果我們在之前介紹的背景下考慮上面的例子,我們會看到優化器在兩種情況下都會使用資料字典表上的索引,



 
mysql > EXPLAIN SELECT TABLE_NAME FROM INFORMATION_SCHEMA. TABLES WHERE TABLE_SCHEMA = 'test' AND TABLE_NAME = 't1';
+ --+-----------+-----++------+------------------+----------++----------------------+----+--------+----------------------------------+
|id|select_type|table ||type |possible_keys |key ||ref |rows|filtered|Extra |
+ --+-----------+-----++------+------------------+----------++----------------------+----+--------+----------------------------------+
| 1|SIMPLE |cat ||index |PRIMARY |name ||NULL | 1| 100. 00|Using index |
| 1|SIMPLE |sch ||eq_ref|PRIMARY,catalog_id|catalog_id || mysql. cat.id,const | 1| 100. 00|Using index |
| 1|SIMPLE |tbl ||eq_ref|schema_id |schema_id || mysql. sch.id,const | 1| 10. 00|Using index condition; Using where|
| 1|SIMPLE |col ||eq_ref|PRIMARY |PRIMARY || mysql. tbl.collation_id| 1| 100. 00|Using index |
+ --+-----------+-----++------+------------------+----------++----------------------+----+--------+----------------------------------+

mysql > EXPLAIN SELECT TABLE_NAME FROM INFORMATION_SCHEMA. TABLES WHERE TABLE_SCHEMA like 'test%' AND TABLE_NAME like 't%';
+ --+-----------+-----++------+------------------+----------++-----------------------+----+--------+---------------------------------+
|id|select_type|table ||type |possible_keys |key || ref |rows|filtered|Extra |
+ --+-----------+-----++------+------------------+----------++-----------------------+----+--------+---------------------------------+
| 1|SIMPLE |cat ||index |PRIMARY |name || NULL | 1| 100. 00|Using index |
| 1|SIMPLE |sch ||ref |PRIMARY,catalog_id|catalog_id || mysql. cat.id | 6| 16. 67|Using where; Using index |
| 1|SIMPLE |tbl ||ref |schema_id |schema_id || mysql. sch.id | 26| 1. 11|Using index condition;Using where|
| 1|SIMPLE |col ||eq_ref|PRIMARY |PRIMARY || mysql. tbl.collation_id| 1| 100. 00|Using index |
+ --+-----------+-----++------+------------------+----------++-----------------------+----+--------+---------------------------------+


When we look at performance gain with this new INFORMATION_SCHEMA design in 8.0, we see that it is much more efficient than MySQL 5.7. As an example, this query is now ~100 times faster (with 100 databases with 50 tables each). A separate blog will describe more about performance of INFORMATION_SCHEMA in 8.0.
當我們通過這個全新的8.0設計的 INFORMATION_SCHEMA 來看性能提升時,我們發現它比MySQL 5.7更有效, 例如,此查詢現在快?100倍(100個資料庫,每個50個表), 另外一篇博客將詳細介紹8.0 中 INFORMATION_SCHEMA 性能 ,



 
SELECT TABLE_SCHEMA, TABLE_NAME, TABLE_TYPE, ENGINE, ROW_FORMAT
FROM information_schema. tables
WHERE TABLE_SCHEMA LIKE 'db%';

Sources of Metadata


Not all the INFORMATION_SCHEMA tables are implemented as a VIEW over the data dictionary tables in 8.0. Currently we have the following INFORMATION_SCHEMA tables designed as views:
并非所有 INFORMATION_SCHEMA 表都通過8.0中的資料字典表作為視圖實作, 目前,我們將以下 INFORMATION_SCHEMA 表設計為視圖:


  • SCHEMATA
  • TABLES
  • COLUMNS
  • VIEWS
  • CHARACTER_SETS
  • COLLATIONS
  • COLLATION_CHARACTER_SET_APPLICABILITY
  • STATISTICS
  • KEY_COLUMN_USAGE
  • TABLE_CONSTRAINTS



Upcoming MySQL 8.0 versions aims to provide even the following INFORMATION_SCHEMA tables as views:
即將推出的MySQL 8.0版本將提供以下 INFORMATION_SCHEMA 表作為視圖:


  • EVENTS
  • TRIGGERS
  • ROUTINES
  • REFERENTIAL_CONSTRAINTS


To describe the INFORMATION_SCHEMA queries which are not directly implemented as VIEWs over data dictionary tables, let me first describe that there are two types of meta data which are presented in INFORMATION_SCHEMA tables:
為了描述INFORMATION_SCHEMA查詢,這些查詢沒有直接實作為資料字典表上的視圖, 讓我首先描述在 INFORMATION_SCHEMA 表中有兩種型別的元資料:
  • Static table metadata. For example: TABLE_SCHEMA , TABLE_NAME , TABLE_TYPE , ENGINE . These statistics will be read directly from the data dictionary.
  • Dynamic table metadata. For example: AUTO_INCREMENT , AVG_ROW_LENGTH , DATA_FREE . Dynamic metadata frequently changes (for example: the auto_increment value will advance after each insert).In many cases the dynamic metadata will also incur some cost to accurately calculate on demand, and accuracy may not be beneficial for the typical query. Consider the case of the DATA_FREE statistic which shows the number of free bytes in a table – a cached value is usually sufficient.
  • 靜態表元資料, 例如: TABLE_SCHEMA , TABLE_NAME , TABLE_TYPE , ENGINE , 這些靜態資料將會從資料字典中直接讀取
  • 動態表元資料, 例如: AUTO_INCREMENT , AVG_ROW_LENGTH , DATA_FREE , 動態元資料經常會變更(例如: 自增值會在每次插入后自增), 在許多情況下,動態元資料也會產生一些成本,以便按需準確計算,并且對于某些特定的查詢這個準確性并沒有用, 考慮 DATA_FREE 統計資訊的情況,該統計資訊顯示表中的空閑位元組數 - 快取值通常就足夠了,


In MySQL 8.0, the dynamic table metadata will default to being cached. This is configurable via the setting information_schema_stats (default cached ), and can be changed to information_schema_stats=latest in order to always retrieve the dynamic information directly from the storage engine (at the cost of slightly higher query execution).
在MySQL 8.0中,動態表元資料將默認為快取, 這可以通過設定 information_schema_stats (默認 快取 )進行配置,并且可以更改為 information_schema_stats = latest ,以便始終直接從存盤引擎檢索動態資訊(以稍高的查詢執行為代價)
As an alternative, the user can also execute ANALYZE TABLE on the table, to update the cached dynamic statistics.
作為替代方案,用戶還可以在表 上執行 ANALYZE TABLE ,以更新快取的動態統計資訊,

Conclusion
The INFORMATION_SCHEMA design in 8.0 is a step forward enabling:


    • Simple and maintainable implementation.
    • Us to get rid of numerous INFORMATION_SCHEMA legacy bugs.
    • Proper use of the MySQL optimizer for INFORMATION_SCHEMA queries.
    • INFORMATION_SCHEMA queries to execute ~100 times faster, compared to 5.7, when retrieving static table metadata, as show in query Q1.


8.0中的 INFORMATION_SCHEMA 設計是向前邁出的一步:


    • 簡單且可維護的實作,
    • 我們擺脫了很多的 INFORMATION_SCHEMA 遺留漏洞,
    • 正確使用MySQL優化器進行 INFORMATION_SCHEMA 查詢,
    • 與檢索靜態表元資料時的5.7相比, INFORMATION_SCHEMA 查詢執行速度快~100倍,如查詢Q1中所示,


There is more to discuss about INFORMATION_SCHEMA in 8.0. The new implementation comes with a few changes in behavior when compared to the old INFORMATION_SCHEMA implementation. Please check the MySQL manual for more details about it.
Thanks for using MySQL!
在8.0中還有更多關于 INFORMATION_SCHEMA的 討論, 與舊的 INFORMATION_SCHEMA 實作相比,新的實作方式有一些變化, 有關它的更多詳細資訊,請查看MySQL手冊,
感謝您使用MySQL!


鏈接1:
http://dev.mysql.com/doc/refman/5.7/en/information-schema-optimization.html
鏈接2: http://mysqlserverteam.com/a-new-data-dictionary-for-mysql/


END



640?wx_fmt=png




640?wx_fmt=gif



掃碼加入MySQL技術Q群

(群號:529671799)





轉載請註明出處,本文鏈接:https://www.uj5u.com/shujuku/224343.html

標籤:其他

上一篇:MySQL對varchar欄位使用int查詢會發生什么?

下一篇:MySQL學習筆記總結(小白必看+基礎篇)

標籤雲
其他(157675) Python(38076) JavaScript(25376) Java(17977) C(15215) 區塊鏈(8255) C#(7972) AI(7469) 爪哇(7425) MySQL(7132) html(6777) 基礎類(6313) sql(6102) 熊猫(6058) PHP(5869) 数组(5741) R(5409) Linux(5327) 反应(5209) 腳本語言(PerlPython)(5129) 非技術區(4971) Android(4554) 数据框(4311) css(4259) 节点.js(4032) C語言(3288) json(3245) 列表(3129) 扑(3119) C++語言(3117) 安卓(2998) 打字稿(2995) VBA(2789) Java相關(2746) 疑難問題(2699) 细绳(2522) 單片機工控(2479) iOS(2429) ASP.NET(2402) MongoDB(2323) 麻木的(2285) 正则表达式(2254) 字典(2211) 循环(2198) 迅速(2185) 擅长(2169) 镖(2155) 功能(1967) .NET技术(1958) Web開發(1951) python-3.x(1918) HtmlCss(1915) 弹簧靴(1913) C++(1909) xml(1889) PostgreSQL(1872) .NETCore(1853) 谷歌表格(1846) Unity3D(1843) for循环(1842)

熱門瀏覽
  • GPU虛擬機創建時間深度優化

    **?桔妹導讀:**GPU虛擬機實體創建速度慢是公有云面臨的普遍問題,由于通常情況下創建虛擬機屬于低頻操作而未引起業界的重視,實際生產中還是存在對GPU實體創建時間有苛刻要求的業務場景。本文將介紹滴滴云在解決該問題時的思路、方法、并展示最終的優化成果。 從公有云服務商那里購買過虛擬主機的資深用戶,一 ......

    uj5u.com 2020-09-10 06:09:13 more
  • 可編程網卡芯片在滴滴云網路的應用實踐

    **?桔妹導讀:**隨著云規模不斷擴大以及業務層面對延遲、帶寬的要求越來越高,采用DPDK 加速網路報文處理的方式在橫向縱向擴展都出現了局限性。可編程芯片成為業界熱點。本文主要講述了可編程網卡芯片在滴滴云網路中的應用實踐,遇到的問題、帶來的收益以及開源社區貢獻。 #1. 資料中心面臨的問題 隨著滴滴 ......

    uj5u.com 2020-09-10 06:10:21 more
  • 滴滴資料通道服務演進之路

    **?桔妹導讀:**滴滴資料通道引擎承載著全公司的資料同步,為下游實時和離線場景提供了必不可少的源資料。隨著任務量的不斷增加,資料通道的整體架構也隨之發生改變。本文介紹了滴滴資料通道的發展歷程,遇到的問題以及今后的規劃。 #1. 背景 資料,對于任何一家互聯網公司來說都是非常重要的資產,公司的大資料 ......

    uj5u.com 2020-09-10 06:11:05 more
  • 滴滴AI Labs斬獲國際機器翻譯大賽中譯英方向世界第三

    **桔妹導讀:**深耕人工智能領域,致力于探索AI讓出行更美好的滴滴AI Labs再次斬獲國際大獎,這次獲獎的專案是什么呢?一起來看看詳細報道吧! 近日,由國際計算語言學協會ACL(The Association for Computational Linguistics)舉辦的世界最具影響力的機器 ......

    uj5u.com 2020-09-10 06:11:29 more
  • MPP (Massively Parallel Processing)大規模并行處理

    1、什么是mpp? MPP (Massively Parallel Processing),即大規模并行處理,在資料庫非共享集群中,每個節點都有獨立的磁盤存盤系統和記憶體系統,業務資料根據資料庫模型和應用特點劃分到各個節點上,每臺資料節點通過專用網路或者商業通用網路互相連接,彼此協同計算,作為整體提供 ......

    uj5u.com 2020-09-10 06:11:41 more
  • 滴滴資料倉庫指標體系建設實踐

    **桔妹導讀:**指標體系是什么?如何使用OSM模型和AARRR模型搭建指標體系?如何統一流程、規范化、工具化管理指標體系?本文會對建設的方法論結合滴滴資料指標體系建設實踐進行解答分析。 #1. 什么是指標體系 ##1.1 指標體系定義 指標體系是將零散單點的具有相互聯系的指標,系統化的組織起來,通 ......

    uj5u.com 2020-09-10 06:12:52 more
  • 單表千萬行資料庫 LIKE 搜索優化手記

    我們經常在資料庫中使用 LIKE 運算子來完成對資料的模糊搜索,LIKE 運算子用于在 WHERE 子句中搜索列中的指定模式。 如果需要查找客戶表中所有姓氏是“張”的資料,可以使用下面的 SQL 陳述句: SELECT * FROM Customer WHERE Name LIKE '張%' 如果需要 ......

    uj5u.com 2020-09-10 06:13:25 more
  • 滴滴Ceph分布式存盤系統優化之鎖優化

    **桔妹導讀:**Ceph是國際知名的開源分布式存盤系統,在工業界和學術界都有著重要的影響。Ceph的架構和演算法設計發表在國際系統領域頂級會議OSDI、SOSP、SC等上。Ceph社區得到Red Hat、SUSE、Intel等大公司的大力支持。Ceph是國際云計算領域應用最廣泛的開源分布式存盤系統, ......

    uj5u.com 2020-09-10 06:14:51 more
  • es~通過ElasticsearchTemplate進行聚合~嵌套聚合

    之前寫過《es~通過ElasticsearchTemplate進行聚合操作》的文章,這一次主要寫一個嵌套的聚合,例如先對sex集合,再對desc聚合,最后再對age求和,共三層嵌套。 Aggregations的部分特性類似于SQL語言中的group by,avg,sum等函式,Aggregation ......

    uj5u.com 2020-09-10 06:14:59 more
  • 爬蟲日志監控 -- Elastc Stack(ELK)部署

    傻瓜式部署,只需替換IP與用戶 導讀: 現ELK四大組件分別為:Elasticsearch(核心)、logstash(處理)、filebeat(采集)、kibana(可視化) 下載均在https://www.elastic.co/cn/downloads/下tar包,各組件版本最好一致,配合fdm會 ......

    uj5u.com 2020-09-10 06:15:05 more
最新发布
  • day02-2-商鋪查詢快取

    功能02-商鋪查詢快取 3.商鋪詳情快取查詢 3.1什么是快取? 快取就是資料交換的緩沖區(稱作Cache),是存盤資料的臨時地方,一般讀寫性能較高。 快取的作用: 降低后端負載 提高讀寫效率,降低回應時間 快取的成本: 資料一致性成本 代碼維護成本 運維成本 3.2需求說明 如下,當我們點擊商店詳 ......

    uj5u.com 2023-04-20 08:33:24 more
  • MySQL中binlog備份腳本分享

    關于MySQL的二進制日志(binlog),我們都知道二進制日志(binlog)非常重要,尤其當你需要point to point災難恢復的時侯,所以我們要對其進行備份。關于二進制日志(binlog)的備份,可以基于flush logs方式先切換binlog,然后拷貝&壓縮到到遠程服務器或本地服務器 ......

    uj5u.com 2023-04-20 08:28:06 more
  • day02-短信登錄

    功能實作02 2.功能01-短信登錄 2.1基于Session實作登錄 2.1.1思路分析 2.1.2代碼實作 2.1.2.1發送短信驗證碼 發送短信驗證碼: 發送驗證碼的介面為:http://127.0.0.1:8080/api/user/code?phone=xxxxx<手機號> 請求方式:PO ......

    uj5u.com 2023-04-20 08:27:27 more
  • 快取與資料庫雙寫一致性幾種策略分析

    本文將對幾種快取與資料庫保證資料一致性的使用方式進行分析。為保證高并發性能,以下分析場景不考慮執行的原子性及加鎖等強一致性要求的場景,僅追求最終一致性。 ......

    uj5u.com 2023-04-20 08:26:48 more
  • sql陳述句優化

    問題查找及措施 問題查找 需要找到具體的代碼,對其進行一對一優化,而非一直把關注點放在服務器和sql平臺 降低簡化每個事務中處理的問題,盡量不要讓一個事務拖太長的時間 例如檔案上傳時,應將檔案上傳這一步放在事務外面 微軟建議 4.啟動sql定時執行計劃 怎么啟動sqlserver代理服務-百度經驗 ......

    uj5u.com 2023-04-20 08:26:35 more
  • 云時代,MySQL到ClickHouse資料同步產品對比推薦

    ClickHouse 在執行分析查詢時的速度優勢很好的彌補了MySQL的不足,但是對于很多開發者和DBA來說,如何將MySQL穩定、高效、簡單的同步到 ClickHouse 卻很困難。本文對比了 NineData、MaterializeMySQL(ClickHouse自帶)、Bifrost 三款產品... ......

    uj5u.com 2023-04-20 08:26:29 more
  • sql陳述句優化

    問題查找及措施 問題查找 需要找到具體的代碼,對其進行一對一優化,而非一直把關注點放在服務器和sql平臺 降低簡化每個事務中處理的問題,盡量不要讓一個事務拖太長的時間 例如檔案上傳時,應將檔案上傳這一步放在事務外面 微軟建議 4.啟動sql定時執行計劃 怎么啟動sqlserver代理服務-百度經驗 ......

    uj5u.com 2023-04-20 08:25:13 more
  • Redis 報”OutOfDirectMemoryError“(堆外記憶體溢位)

    Redis 報錯“OutOfDirectMemoryError(堆外記憶體溢位) ”問題如下: 一、報錯資訊: 使用 Redis 的業務介面 ,產生 OutOfDirectMemoryError(堆外記憶體溢位),如圖: 格式化后的報錯資訊: { "timestamp": "2023-04-17 22: ......

    uj5u.com 2023-04-20 08:24:54 more
  • day02-2-商鋪查詢快取

    功能02-商鋪查詢快取 3.商鋪詳情快取查詢 3.1什么是快取? 快取就是資料交換的緩沖區(稱作Cache),是存盤資料的臨時地方,一般讀寫性能較高。 快取的作用: 降低后端負載 提高讀寫效率,降低回應時間 快取的成本: 資料一致性成本 代碼維護成本 運維成本 3.2需求說明 如下,當我們點擊商店詳 ......

    uj5u.com 2023-04-20 08:24:03 more
  • day02-短信登錄

    功能實作02 2.功能01-短信登錄 2.1基于Session實作登錄 2.1.1思路分析 2.1.2代碼實作 2.1.2.1發送短信驗證碼 發送短信驗證碼: 發送驗證碼的介面為:http://127.0.0.1:8080/api/user/code?phone=xxxxx<手機號> 請求方式:PO ......

    uj5u.com 2023-04-20 08:23:11 more