mirror of
https://github.com/tiennm99/thptqg.git
synced 2026-08-24 23:23:33 +00:00
The browser fetches this file one page per HTTP request, so the page size is the granularity of every read. At SQLite's 4 KiB default a row reached by an index seek dragged 4 KB across the network; at 1 KiB it drags 1 KB. A name search returns up to 100 scattered rows, so its row fetches fall from about 400 KB to about 100 KB. Measured on the rebuilt 2016 file: 6.3 rows share a page where 27 did. The index walks are sequential and unaffected in bytes — the library's read-ahead already collapses those into few requests. Cost is 4% file size: 2016 288.6 -> 302.4 MB, 2017 237.7 -> 247.3 MB, the site 528 -> 552 MB against the 1 GB GitHub Pages limit. Both sql.js-httpvfs and sqlite-wasm-http recommend this page size. The PRAGMA has to run before the DDL, since a page size is fixed once a table exists, and requestChunkSize on the client has to match or every page read spans two requests. Row counts unchanged and through the assembler guards; query plans re-checked and still index-driven on the rebuilt files.
32 lines
1.2 KiB
JSON
32 lines
1.2 KiB
JSON
{
|
|
"_comment": [
|
|
"The dataset registry: the one place every pipeline stage agrees on what",
|
|
"exists. JSON because the Go stages and the Vite app both read it.",
|
|
"",
|
|
" id the identifier used end to end, from data/<id>/ to /thptqg/<id>/",
|
|
" expectedRows exact row count of the built database, not an estimate. The",
|
|
" inputs are frozen exam results, so a deviation of even one row",
|
|
" means something changed unintentionally and the assembler",
|
|
" refuses to publish.",
|
|
" dbSizeMb usual size of the published database. Required and non-zero:",
|
|
" the assembler rejects a build that comes out far smaller. The",
|
|
" file is served uncompressed and read a page at a time over",
|
|
" HTTP range requests, so nothing downloads it whole.",
|
|
"",
|
|
"Presentation (titles, labels, SQL presets) lives in web/src/datasets.js keyed",
|
|
"by id; that file throws at load if the two lists disagree."
|
|
],
|
|
"datasets": [
|
|
{
|
|
"id": "2016",
|
|
"expectedRows": 877460,
|
|
"dbSizeMb": 302
|
|
},
|
|
{
|
|
"id": "2017",
|
|
"expectedRows": 861068,
|
|
"dbSizeMb": 247
|
|
}
|
|
]
|
|
}
|