25 lines
1.6 KiB
Markdown
25 lines
1.6 KiB
Markdown
# Lab2 level-5 track 2 — query plans and recovery
|
|
|
|
- Run UTC: 2026-10-09T13:21:05.722546+00:00
|
|
- Host: macOS-27.0-arm64-arm-64bit-Mach-O (arm64), logical CPUs: 10
|
|
- Host physical memory: 17179869184 bytes.
|
|
- PostgreSQL: 16.4 in `postgres:16.4-alpine`; container memory limit: 0 bytes; CPU limit: 0 nanocores (0 means unlimited).
|
|
- Dataset: 100,000 synthetic rows in each comparison table; one chat has 80,000 rows and 100 small chats share the remaining 20,000. Only generated text is used.
|
|
- Query: keyset page from chat 2, identical SELECT and cursor for both indexes; each plan was executed five times after ANALYZE.
|
|
|
|
| Index | Median execution (ms) | Shared hits | Shared reads | Rows |
|
|
|---|---:|---:|---:|---:|
|
|
| `(chat_id)` | 0.245 | 206 | 2 | 25 |
|
|
| `(chat_id, created_at, id)` | 0.079 | 25 | 3 | 25 |
|
|
|
|
| Index | Median time for 2,000 inserted rows (ms) | Median shared write blocks |
|
|
|---|---:|---:|
|
|
| `(chat_id)` | 3.970 | 25 |
|
|
| `(chat_id, created_at, id)` | 5.049 | 25 |
|
|
|
|
Each write-cost query was measured five times inside a transaction and rolled back. This isolates execution and index-maintenance work but does not measure durable commit/fsync latency.
|
|
|
|
Backup/restore: custom-format dump 1596489 bytes; dump 0.260s; restore into a separately created empty database 0.318s. Restored row counts and deterministic checksums for the selected messages were verified: **PASS**.
|
|
|
|
Raw JSON plans, samples, environment and restore checksums are in `track5_query_restore.json`. This single-host synthetic run is a reproducible comparison, not a production capacity or HA claim.
|