TAG
Database
52 notes
- 1.MySQLhistorical
This page collects MySQL notes on installation, data types, architecture, replication, troubleshooting, and load testing.
- 1.1 MySQL explainhistorical
EXPLAIN shows how MySQL executes SQL, including table access order and access methods, helping analyze queries and identify optimization opportunities.
- 1.2 MySQL Primary-Replica Replicationhistorical
MySQL leader-follower replication synchronizes data from the primary to replicas. These notes examine usage and execution through read-heavy scenarios.
- 1.3 MySQL SQL Tuninghistorical
These notes record SQL-tuning scenarios, starting with data volume and concurrency and examining changes such as limiting query ranges.
- 1.4 MySQL Installation and Configurationhistorical
These notes record MySQL installation and configuration, including replication identifiers, error logs, and checks after startup.
- 1.5 MySQL Query Optimizerhistorical
A SQL statement may have several execution plans. The MySQL optimizer uses query trees and cost estimates to choose a suitable plan.
- 1.6 MySQL Storage Engineshistorical
MySQL storage engines manage data storage and interact with the underlying file system when executing SQL operations.
- 1.7 MySQL Lockshistorical
MySQL lock structures record their transaction and wait state. These notes use those fields to examine how locks relate to transactions and data.
- 1.8 MySQL Indexeshistorical
MySQL Indexes: An index is a structure that sorts the values of one or more columns in a database table and is a data structure (B+Tree) that helps MySQL obtain data efficiently.
- 1.9 MySQL Index Implementationhistorical
MySQL Index Implementation: In the InnoDB storage engine, each index corresponds to a B+ tree.
- 1.10 MySQL File Systemhistorical
Each database has a subdirectory in the MySQL data directory. These notes examine how database creation relates to the files stored there.
- 1.11 MySQL Pageshistorical
Records are stored within pages in a defined format. These notes examine MySQL page organization through row formats and variable-length-field information.
- 1.12 MySQL Data Typeshistorical
This note presents MySQL data types in a reference diagram for reviewing field-type choices.
- 1.13 MySQL bin-loghistorical
The binlog is an archival log at the MySQL Server layer. It records operations that change the database, rather than ordinary queries.
- 1.14 MySQL Architecturehistorical
MySQL requests pass through connection management and query-processing components. These notes organize the architecture along the path of a client request.
- 1.15 MySQL Connectorhistorical
The MySQL connector manages client connections. Once established, an idle connection can be closed according to the server's timeout settings.
- 1.16 MySQL Statisticshistorical
MySQL uses statistics to estimate query costs. These notes cover how statistics are stored and used when choosing execution plans.
- 1.17 MySQL Table Access Methodshistorical
MySQL uses access methods, or access types, to describe how queries retrieve table records. These notes examine the different methods and their characteristics.
- 1.18 MySQL Slow Query Loghistorical
The MySQL slow query log records SQL statements whose execution time exceeds a threshold, helping identify queries for further analysis.
- 1.19 MySQL show profilehistorical
Use MySQL profiling to inspect query execution records, then use show profile to examine CPU and block-I/O costs for a selected query.
- 1.20 System Databaseshistorical
MySQL system databases store information such as permissions, stored routines, events, logs, help, and time zones. These notes describe the role of each database.
- 1.21 MySQL Parserhistorical
The MySQL parser breaks SQL statements into tokens and analyzes their syntax before optimization and execution.
- 1.22 MySQL Executorhistorical
The MySQL executor checks permissions and executes SQL through storage-engine interfaces that read or modify data.
- 1.23 MySQL Production Issue Troubleshootinghistorical
MySQL production troubleshooting can begin with active sessions and resource-heavy SQL, followed by analysis with tools such as EXPLAIN. These notes record the commands.
- 1.25 Cloud MySQLhistorical
These notes record the nodes and configuration of an example Tencent Cloud MySQL environment, including deployment relationships and usage.
- 1.26 MySQL InnoDB Buffer Poolhistorical
The InnoDB buffer pool is memory allocated when MySQL starts to cache table and index data and reduce disk I/O.
- 1.27 MySQL Tuninghistorical
MySQL tuning can begin by finding slow SQL through logs or monitoring, then using EXPLAIN to analyze execution plans and locate bottlenecks.
- 1.28 canalhistorical
Canal parses the MySQL binlog to capture incremental changes and synchronize them to systems such as Elasticsearch and Redis.
- 1.29 InnoDB Buffer Poolhistorical
The InnoDB buffer pool is memory allocated when MySQL starts to cache table and index data and reduce disk I/O.
- 1.30 InnoDB MVCChistorical
MVCC, or multiversion concurrency control, maintains data versions so reads and writes can run concurrently, using visibility rules to select the version a transaction reads.
- 1.31 InnoDB redo loghistorical
The redo log supports InnoDB crash recovery by restoring changes that were not fully written before a failure.
- 1.32 InnoDB undo loghistorical
The undo log records logical data changes with inverse operations for inserts, updates, and deletes. These notes explain its relationship to transactions.
- 1.33 InnoDB Transactionshistorical
InnoDB transactions begin with begin or start transaction and finish with commit or rollback. These notes cover transaction operations and their implementation.
- 1.34 InnoDB Tablespaceshistorical
Tablespaces are a logical way to organize InnoDB data. These notes explain storage through the relationships among tablespaces, segments, extents, and pages.
- 1.35 InnoDB and MyISAM Index Comparisonhistorical
InnoDB organizes data and indexes in pages. These notes use pages and B+ trees to compare InnoDB and MyISAM storage layouts.
- 1.36 MySQL InnoDBhistorical
InnoDB uses read and write buffering to reduce repeated disk access. These notes examine the engine's internal structure through those components.
- 1.37 MySQL Flushhistorical
A page is dirty when its contents in memory differ from those on disk. Flushing writes dirty pages to disk to bring them back into agreement.
- 2.PostgreSQLhistorical
This page links PostgreSQL query-analysis and transaction topics, including EXPLAIN, isolation levels, and MVCC.
- 2.1 PostgreSQL Isolation Levelshistorical
PostgreSQL distinguishes isolation levels through snapshot timing. These notes examine the differences through GetTransactionSnapshot and related implementation details.
- 2.2 PostgreSQL MVCChistorical
PostgreSQL MVCC: In PostgreSQL, every transaction gets a transaction ID called XID.
- 2.3 PostgreSQL explainhistorical
PostgreSQL EXPLAIN displays SQL execution plans. These notes use its output to examine access methods and other plan details.
- SQL Join Querieshistorical
Join queries combine records from multiple tables under specified conditions. These notes compare how inner and outer joins match and retain records.
- SQL Execution Orderhistorical
SQL's logical processing order begins with FROM, JOIN, and ON, followed by steps such as WHERE. These notes explain which fields are available at each stage.
- Relational Databasehistorical
Relational databases organize data using the relational model. These notes introduce relations and their components as the basis of the model.
- Database Optimistic Locking and Pessimistic Lockinghistorical
Optimistic locking checks conflicts when committing an update, while pessimistic locking locks data in advance. These notes compare both approaches and version-based implementations.
- Database Transactionshistorical
A database transaction groups reads and writes into a logical unit executed as one operation, with its guarantees described by ACID properties.
- Database Optimizationhistorical
Database optimization can involve data design, configuration, and queries. These notes record approaches such as field denormalization and MySQL configuration changes.
- Database Sharding and Table Shardinghistorical
Database sharding splits one original database into multiple databases; table sharding splits one original table into multiple tables. Both database sharding and table sharding can use horizontal or vertical splitting.
- Database Deadlockshistorical
A deadlock means that two (or more) transactions each hold a lock the other wants. If transaction 1 obtains an exclusive lock on table A while trying to obtain an exclusive lock on table B, and transaction 2 already holds the exclusive lock on table B while requesting an exclusive lock on table A, neither transaction can proceed.
- Database Lock Granularityhistorical
Database locks can operate at row, page, or table granularity, restricting access over different scopes and affecting concurrency and lock-management overhead.
- Database Normal Formshistorical
Database normal forms organize data through constraints on dependencies between attributes and keys. These notes begin with the first normal form and outline subsequent requirements.
- Database Lockshistorical
Concurrent transactions accessing the same data need conflict coordination. These notes introduce database-lock categories and approaches through that problem.