Databases
52 notes
Some notes are currently available only in Chinese. English translations are shown when available.
- 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.