Repository navigation
@odatano/nightgate 0.25.4
@odatano/nightgate 0.25.4
Ordered reads on PostgreSQL use their indexes again. No schema change, no
migration, no config change, no new index.
@cap-js/postgresrenders every ORDER BY term asASC NULLS FIRST/
DESC NULLS LAST. A Postgres btree index has the opposite null order, so
the planner sorted the whole table for everyORDER BY ... LIMIT.- CAP orders every
$topread by the entity key:Blocks?$top=1was a
seq scan + sort over 2M rows, 0.8 to 7.6 s on the hosted box;
Blocks/latest()0.9 s althoughng_blocks_heightexists. - New
srv/utils/pg-order-nulls.ts: wraps the driver's_orderByonce at
start and drops the NULLS clause for key andnot nullcolumns. Nullable
columns and an explicitnullskeep it. - Installed from
src/index.tsbeforeensureIndexeswhen the db kind is
postgres. Missing driver or hook: one warning, nothing changes. test/unit/pg-order-nulls.test.tsrenders through the real driver, so a
driver that changes its ordering terms fails the test.
Full Changelog: v0.25.3...v0.25.4