Repository navigation
Commit bd815e3
db size: Collect the SQLite sizes in a single pass over dbstat
Every dbstat query walks all pages of the database file, so asking for
the table size and the index size separately doubled that work for each
table. One grouped query over dbstat joined to sqlite_master returns
both, which also means the database-wide breakdown costs one query
instead of two.
The dbstat virtual table is not part of every SQLite build. Instead of
letting a failed query pass a silent 0 B on to the output, fail with a
message that names the missing extension.
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01WA7GLFtiJMyt4ZwaDq194v1 parent 5362d5a commit bd815e3
2 files changed
Lines changed: 63 additions & 25 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1301 | 1301 | | |
1302 | 1302 | | |
1303 | 1303 | | |
1304 | | - | |
1305 | | - | |
1306 | | - | |
1307 | | - | |
1308 | | - | |
1309 | | - | |
| 1304 | + | |
1310 | 1305 | | |
1311 | | - | |
1312 | | - | |
1313 | | - | |
1314 | | - | |
1315 | | - | |
1316 | | - | |
| 1306 | + | |
| 1307 | + | |
1317 | 1308 | | |
1318 | 1309 | | |
1319 | 1310 | | |
| |||
1345 | 1336 | | |
1346 | 1337 | | |
1347 | 1338 | | |
1348 | | - | |
1349 | | - | |
1350 | | - | |
| 1339 | + | |
| 1340 | + | |
| 1341 | + | |
| 1342 | + | |
| 1343 | + | |
| 1344 | + | |
| 1345 | + | |
| 1346 | + | |
1351 | 1347 | | |
1352 | 1348 | | |
1353 | 1349 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
553 | 553 | | |
554 | 554 | | |
555 | 555 | | |
556 | | - | |
| 556 | + | |
557 | 557 | | |
558 | | - | |
559 | | - | |
| 558 | + | |
| 559 | + | |
| 560 | + | |
| 561 | + | |
| 562 | + | |
560 | 563 | | |
561 | | - | |
| 564 | + | |
562 | 565 | | |
563 | 566 | | |
564 | | - | |
565 | | - | |
566 | | - | |
567 | | - | |
568 | | - | |
569 | | - | |
| 567 | + | |
| 568 | + | |
| 569 | + | |
| 570 | + | |
| 571 | + | |
| 572 | + | |
| 573 | + | |
| 574 | + | |
| 575 | + | |
| 576 | + | |
| 577 | + | |
| 578 | + | |
| 579 | + | |
| 580 | + | |
| 581 | + | |
| 582 | + | |
| 583 | + | |
| 584 | + | |
| 585 | + | |
| 586 | + | |
| 587 | + | |
| 588 | + | |
| 589 | + | |
| 590 | + | |
| 591 | + | |
| 592 | + | |
| 593 | + | |
| 594 | + | |
| 595 | + | |
| 596 | + | |
| 597 | + | |
| 598 | + | |
| 599 | + | |
| 600 | + | |
| 601 | + | |
| 602 | + | |
| 603 | + | |
| 604 | + | |
| 605 | + | |
| 606 | + | |
| 607 | + | |
| 608 | + | |
| 609 | + | |
| 610 | + | |
| 611 | + | |
570 | 612 | | |
571 | 613 | | |
572 | 614 | | |
| |||
0 commit comments