关于鬼影记录的翻译一 原文链接: 很多年前,我在各种各样的论坛看到关于鬼影清理任务的帖子当我还在存储引擎开发团队的时候。 之前鬼影清除任务有一些bug在里面,KB文章是KB932115和KB815594,不过这两篇文章介绍鬼影机制的信息还是很少 由于某些原因,在我
关于鬼影记录的翻译一
原文链接:
很多年前,我在各种各样的论坛看到关于鬼影清理任务的帖子当我还在存储引擎开发团队的时候。
之前鬼影清除任务有一些bug在里面,KB文章是KB932115和KB815594,服务器空间,不过这两篇文章介绍鬼影机制的信息还是很少
由于某些原因,在我的旧的博客里面没有提及鬼影,今天我打算写一篇深入鬼影清理任务的文章
那么,什么是鬼影清理呢?这是一个后台进程用来清理鬼影记录的.通常与鬼影清理任务一起被提及.
什么是鬼影记录呢?上星期我曾经在anatomy OF a record post主题里简短描述了一下,在一张有索引的表里已经
删除了的一条记录或者在快照隔离级别的数据库里,一张没有任何索引的表里已经删除了的一条记录那条记录就是鬼影记录
从聚集索引表这方面讲述鬼影记录会好一些,鬼影就是一个delete操作,但是他实际不是从数据页进行物理删除,他只是
在数据页标记那条记录“已经删除了”或“已经鬼影了”。这对于删除操作的快速执行是一个性能的优化。
这也让删除操作的回滚执行得更快因为只需要把“已经删除了的”或“已经鬼影了的”的记录重新标记为“未删除“,这样就不用
重新插入已经删除了的记录。已经删除了的记录将会在稍后被一个后台的鬼影清理进程/任务物理删除(删除了的记录的那个位置,
不会被其他记录重写)。鬼影记录会在空的数据页面或者空的索引页面插入一条记录,以避免那个空的数据页面或者空的索引页面
被释放,当回滚事务的时候能保证那个数据页或索引页还存在
鬼影记录清理任务不能物理删除已经被标记为鬼影记录的的记录,除非你提交你的事务,确认删除操作已经提交,因为已经删除的记录
有锁,直到提交事务的时候才会解锁。顺便说一下,如果一条记录被标记为“已经删除了的”在一个数据页上,那么,就算加上nolock选项
或者使用READ UNCOMMITTED隔离级别也不能读取得到已经标记为“鬼影”的那条记录
当一条记录已经被删除,并且标记为鬼影记录,那么鬼影记录所在的那个数据页也会被标记为鬼影页面,在PFS页面会有所体现
并且信息会记录在数据页的页面头部。在PFS页记录当前存在鬼影记录的数据页,也能提醒数据库,当前数据库中存在一些鬼影记录
还没有去清理。鬼影记录清理任务不知道哪些数据页面有鬼影记录就算有删除操作发生。只有当扫描操作读取到已经标记为鬼影的
数据页面的时候。
鬼影记录清理任务每5秒钟进行一次查找鬼影记录的任务。扫描任务通过每个数据库的PFS页,查看是否有鬼影记录页面存在,
如果存在就通知鬼影清理任务清理鬼影记录页面里的鬼影记录。如果不存在,扫描任务就去扫描下一个数据库。
鬼影清理任务每次清理最多10个页面的鬼影记录,在我印象中好像是10个页面,以确保系统不会有任何影响。
所以,鬼影记录最终一定会被删除,通过鬼影清理任务。如果鬼影清理任务扫描到当前数据库没有鬼影记录,香港空间,那么他就会
跳过这个数据库去扫描下一个数据库
您能够告诉鬼影记录清理任务是怎样工作的吗?在SQLSERVER2005里,您能够使用下面的代码在
sys.dm_exec_requests视图里查看鬼影清理任务
##myexecrequests 5 FROM sys.dm_exec_requests ; NOCOUNT ON; ; ) ##myexecrequests sys.dm_exec_requests (*) 19 FROM ##myexecrequests 20 END; ##myexecrequests; ,美国空间

TograntpermissionstonewMySQLusers,followthesesteps:1)AccessMySQLasauserwithsufficientprivileges,2)CreateanewuserwiththeCREATEUSERcommand,3)UsetheGRANTcommandtospecifypermissionslikeSELECT,INSERT,UPDATE,orALLPRIVILEGESonspecificdatabasesortables,and4)

ToaddusersinMySQLeffectivelyandsecurely,followthesesteps:1)UsetheCREATEUSERstatementtoaddanewuser,specifyingthehostandastrongpassword.2)GrantnecessaryprivilegesusingtheGRANTstatement,adheringtotheprincipleofleastprivilege.3)Implementsecuritymeasuresl

ToaddanewuserwithcomplexpermissionsinMySQL,followthesesteps:1)CreatetheuserwithCREATEUSER'newuser'@'localhost'IDENTIFIEDBY'password';.2)Grantreadaccesstoalltablesin'mydatabase'withGRANTSELECTONmydatabase.TO'newuser'@'localhost';.3)Grantwriteaccessto'

The string data types in MySQL include CHAR, VARCHAR, BINARY, VARBINARY, BLOB, and TEXT. The collations determine the comparison and sorting of strings. 1.CHAR is suitable for fixed-length strings, VARCHAR is suitable for variable-length strings. 2.BINARY and VARBINARY are used for binary data, and BLOB and TEXT are used for large object data. 3. Sorting rules such as utf8mb4_unicode_ci ignores upper and lower case and is suitable for user names; utf8mb4_bin is case sensitive and is suitable for fields that require precise comparison.

The best MySQLVARCHAR column length selection should be based on data analysis, consider future growth, evaluate performance impacts, and character set requirements. 1) Analyze the data to determine typical lengths; 2) Reserve future expansion space; 3) Pay attention to the impact of large lengths on performance; 4) Consider the impact of character sets on storage. Through these steps, the efficiency and scalability of the database can be optimized.

MySQLBLOBshavelimits:TINYBLOB(255bytes),BLOB(65,535bytes),MEDIUMBLOB(16,777,215bytes),andLONGBLOB(4,294,967,295bytes).TouseBLOBseffectively:1)ConsiderperformanceimpactsandstorelargeBLOBsexternally;2)Managebackupsandreplicationcarefully;3)Usepathsinst

The best tools and technologies for automating the creation of users in MySQL include: 1. MySQLWorkbench, suitable for small to medium-sized environments, easy to use but high resource consumption; 2. Ansible, suitable for multi-server environments, simple but steep learning curve; 3. Custom Python scripts, flexible but need to ensure script security; 4. Puppet and Chef, suitable for large-scale environments, complex but scalable. Scale, learning curve and integration needs should be considered when choosing.

Yes,youcansearchinsideaBLOBinMySQLusingspecifictechniques.1)ConverttheBLOBtoaUTF-8stringwithCONVERTfunctionandsearchusingLIKE.2)ForcompressedBLOBs,useUNCOMPRESSbeforeconversion.3)Considerperformanceimpactsanddataencoding.4)Forcomplexdata,externalproc


Hot AI Tools

Undresser.AI Undress
AI-powered app for creating realistic nude photos

AI Clothes Remover
Online AI tool for removing clothes from photos.

Undress AI Tool
Undress images for free

Clothoff.io
AI clothes remover

Video Face Swap
Swap faces in any video effortlessly with our completely free AI face swap tool!

Hot Article

Hot Tools

SublimeText3 Linux new version
SublimeText3 Linux latest version

Dreamweaver Mac version
Visual web development tools

EditPlus Chinese cracked version
Small size, syntax highlighting, does not support code prompt function

ZendStudio 13.5.1 Mac
Powerful PHP integrated development environment

MantisBT
Mantis is an easy-to-deploy web-based defect tracking tool designed to aid in product defect tracking. It requires PHP, MySQL and a web server. Check out our demo and hosting services.
