MySQL 数据库由于性能高,成本低,可靠性好等优点,已经成为最流行的开源关系型数据库产品,广泛地被使用在互联网上的中小型网站中。并且随着MySQL的不断成熟,以及一些企业特性的加入,它也逐渐被用于更大规模的网站和应用系统中,如我们知道的维基百科,谷
MySQL 数据库由于性能高,成本低,可靠性好等优点,已经成为最流行的开源关系型数据库产品,广泛地被使用在互联网上的中小型网站中。并且随着MySQL的不断成熟,以及一些企业特性的加入,它也逐渐被用于更大规模的网站和应用系统中,如我们知道的维基百科,谷歌和facebook等。目前互联网上流行的网站架构方式LAMP,WNMP和LNMP,其中的“M”都是MySQL,这些都是免费或开放源代码软件,使用这种方式可以以很低的成本构建网站系统和其它应用。因此,MySQL越来越受到企业和个人开发者的厚爱。
MySQL是一个非常容易上手的数据库产品,很多人只要很短的时间就可以使用它。但是,作为一个有经验的的数据库应用程序的开发者写出来的sql查询语句和新手写出的sql语句在执行性能方面有巨大的差别,其根本的原因在于有经验的数据库应用开发者善于运用mysql的索引以及各种性能分析调优工具优化自己的查询。
但是,估计现在很多做开发的,对数据库优化都只是一个不是很清晰的概念或者一个全面的理解。我也是其中一个,虽然自己搞MySQL很长时间了。但大多数的情况下只是简单的使用sql语句,骨子里一直认为数据库应该是有专门的人士来搞,而这个人不应该是我这样的开发者。但是从实际上来看,这个角色经常是由开发人员来担任的。也就是说,作为一名日常“开发人员”,除了完成自己的本职工作外,最常重复的工作就是在生产环境中检查和优化运行的SQL语句。当MySQL软件安装、配置以及正常运行之后,监控数据库的性能问题就成为一项经常重复的工作。了解如何正确地截取有问题的SQL语句以及检查并做适当的调整,这已经成为一个专业技术人员的必备技能。
曾经一直以为使用一个alter语句在什么时候都可以的,可没想过要考虑什么因素,可刚看到《Effectove MySQL之SQL语句最优化》的第一章第二节就有这么一句话“在此期间,由于aletr语句是阻塞操作,因此所有为表添加和修改数据的额外请求都被阻塞了”。在这之前,一直都认为无论何时给一个表增加或者修改字段都可以的,根本没想过会影响其他的因素。《Effectove MySQL之SQL语句最优化》的第一章就讲了如何寻找缓慢的SQL语句,同时也介绍了几种用于优化语句的分析工具,包括EXPLAIN和SHOW CREATE TABLE。同时了解了应该重点关注能够识别性能问题的那些属性。同时知道优化SQL语句绝不仅仅是添加索引。这个虽然很早就知道,不过刚接触的SQL的都不太清楚。
下面我们看一下该书的目录图:
全书一共分为8章,每一章还有小结,全书很值得一读,学完了对mysql优化有一个进步的提升。本书的作者是Ronald Bradford,它写过一本《PHP+MySQL专家编程》,我没有看过中译本,因为它刚刚被引进,看过英文的电子版,写的还是不错的,因此,本书的内容还是很值得一看的。
该书是按照概念,实例,总结的模式来写的,比较符合学习知识的认知过程。该书不是很厚,只有短短的200页,这类书可以普遍归结到我们目前有的比如21天学通Java,什么24小时学通MySQL之类,但这本书比那些书要好很多,至少不是胡编乱造,抄写help吧,至少mysql的帮助也很少提供有关优化的方法,最多会给出一些概念罢了!
推荐指数:四星级
适合人群:有一定sql基础,想继续学习提供的人群
前面说了那么多,还是说说读完后的感想:老外写的书大都是比较贴近实际,比较务实的。 重点还是介绍了MySQL在调优过程中,常见的方法,以及适用的场景。
案例占据了书的一半版面,读者跟随书的介绍做一遍,一定会有不同程度的收获,属于开卷有益类的书籍
其实最有效的sql优化方法应该是:大处着眼,小处着手,通盘考虑,先看后动
具体的技术手段很多,索引,分区,配置等等,但都需要在深入理解问题以后,才能更好的解决问题
但本书还是存在的一些小毛病,就是在进行技术细节概念讲述的时候,并不直接给出概念的定义,而是跳跃式的讲解,很容易打断人的思路,我看的时候会时不时思想就开了小差,也许不太喜欢这类讲法吧!
还有就是没有指出案例是在什么环境下运行,windows还是linux还是别的什么环境下,因为,我在windows环境下运行了某些实例,发现居然有些不能运行,真是比较晕。
写的比较乱,不妥之处还忘大家海涵!

InnoDBBufferPool reduces disk I/O by caching data and indexing pages, improving database performance. Its working principle includes: 1. Data reading: Read data from BufferPool; 2. Data writing: After modifying the data, write to BufferPool and refresh it to disk regularly; 3. Cache management: Use the LRU algorithm to manage cache pages; 4. Reading mechanism: Load adjacent data pages in advance. By sizing the BufferPool and using multiple instances, database performance can be optimized.

Compared with other programming languages, MySQL is mainly used to store and manage data, while other languages such as Python, Java, and C are used for logical processing and application development. MySQL is known for its high performance, scalability and cross-platform support, suitable for data management needs, while other languages have advantages in their respective fields such as data analytics, enterprise applications, and system programming.

MySQL is worth learning because it is a powerful open source database management system suitable for data storage, management and analysis. 1) MySQL is a relational database that uses SQL to operate data and is suitable for structured data management. 2) The SQL language is the key to interacting with MySQL and supports CRUD operations. 3) The working principle of MySQL includes client/server architecture, storage engine and query optimizer. 4) Basic usage includes creating databases and tables, and advanced usage involves joining tables using JOIN. 5) Common errors include syntax errors and permission issues, and debugging skills include checking syntax and using EXPLAIN commands. 6) Performance optimization involves the use of indexes, optimization of SQL statements and regular maintenance of databases.

MySQL is suitable for beginners to learn database skills. 1. Install MySQL server and client tools. 2. Understand basic SQL queries, such as SELECT. 3. Master data operations: create tables, insert, update, and delete data. 4. Learn advanced skills: subquery and window functions. 5. Debugging and optimization: Check syntax, use indexes, avoid SELECT*, and use LIMIT.

MySQL efficiently manages structured data through table structure and SQL query, and implements inter-table relationships through foreign keys. 1. Define the data format and type when creating a table. 2. Use foreign keys to establish relationships between tables. 3. Improve performance through indexing and query optimization. 4. Regularly backup and monitor databases to ensure data security and performance optimization.

MySQL is an open source relational database management system that is widely used in Web development. Its key features include: 1. Supports multiple storage engines, such as InnoDB and MyISAM, suitable for different scenarios; 2. Provides master-slave replication functions to facilitate load balancing and data backup; 3. Improve query efficiency through query optimization and index use.

SQL is used to interact with MySQL database to realize data addition, deletion, modification, inspection and database design. 1) SQL performs data operations through SELECT, INSERT, UPDATE, DELETE statements; 2) Use CREATE, ALTER, DROP statements for database design and management; 3) Complex queries and data analysis are implemented through SQL to improve business decision-making efficiency.

The basic operations of MySQL include creating databases, tables, and using SQL to perform CRUD operations on data. 1. Create a database: CREATEDATABASEmy_first_db; 2. Create a table: CREATETABLEbooks(idINTAUTO_INCREMENTPRIMARYKEY, titleVARCHAR(100)NOTNULL, authorVARCHAR(100)NOTNULL, published_yearINT); 3. Insert data: INSERTINTObooks(title, author, published_year)VA


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

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.

Dreamweaver Mac version
Visual web development tools

SublimeText3 Mac version
God-level code editing software (SublimeText3)

PhpStorm Mac version
The latest (2018.2.1) professional PHP integrated development tool

WebStorm Mac version
Useful JavaScript development tools