Database guides
Database guides
Database Reviews
如果您要创建数据库 MR 进行审查,请查看我们的数据库审查指南 .
它介绍了与数据库相关的更改,迁移和复杂的 SQL 查询.
如果您是数据库审阅者或想成为一名数据库审阅者,请查看我们的数据库审阅简介 .
Tooling
- Understanding EXPLAIN plans
- explain.depesz.com或explain.dalibo.com,用于可视化
EXPLAIN
的输出 - pgFormatter PostgreSQL SQL 语法美化器
Migrations
- What requires downtime?
- 用于 SQL 查询的SQL 准则
- 用于创建安全的 SQL 迁移的迁移样式指南
- Testing Rails migrations guide
- Post deployment migrations
- Background migrations
- Swapping tables
- Deleting migrations
Debugging
- 使用带有Marginalia 的查询注释来跟踪 SQL 查询的源
- 使用详细查询日志在 Rails 控制台中跟踪 SQL 查询的源
Best practices
- Adding database indexes
- Foreign keys & associations
- Adding a foreign key constraint to an existing column
NOT NULL
constraints- Strings and the Text data type
- Single table inheritance
- Polymorphic associations
- Serializing data
- Hash indexes
- Storing SHA1 hashes as binary
- Iterating tables in batches
- Insert into tables in batches
- Ordering table columns
- Verifying database capabilities
- Database Debugging and Troubleshooting
- Query Count Limits
- Creating enums