Skip to content

Release: develop -> main - #4488

Merged
TaprootFreak merged 1 commit into
mainfrom
develop
Jul 30, 2026
Merged

Release: develop -> main#4488
TaprootFreak merged 1 commit into
mainfrom
develop

Conversation

@github-actions

Copy link
Copy Markdown

Automatic Release PR

This PR was automatically created after changes were pushed to develop.

Commits: 1 new commit(s)

Checklist

  • Review all changes
  • Verify CI passes
  • Approve and merge when ready for production

…projection comments (#4484)

* docs(log): fix stale financial-log projection comments and hoist asNumber

The comment above mapSummaryToEntry still claimed that non-numeric
balancesByFinancialType values pass through unchanged; since the typeof
guard that landed in 0defde1 they become undefined instead. Rewrite it
to state both intentional deviations from the old mapLogToEntry path (a
null sub-entry, a wrong-typed sub-entry) and add the previously
undocumented top-level `message: null` case, which now yields a
zero-point row instead of being dropped (not observed in production
today; pinned with a new repository test).

Also note on the asNumber guard that a plain typeof check lets Infinity
through and that NaN cannot occur in valid jsonb, and hoist asNumber
above the per-entry loop instead of recreating it on every iteration.

No behavioural change beyond the asNumber hoist.

* perf(trading-order): add index on created for monthly yield query

TradingOrderService.getTradingOrderYield runs once per minute from
LogJobService and was doing a Parallel Seq Scan on trading_order
(922 MB / 5.4M rows, 146.399 ms per call in production), the same
cost profile the sibling AddLedgerContentChangeScanIndexes migration
already fixed for a different query on the same table.

* docs: correct F20b test name and bank_tx index claim from PR #4484 review

The F20b test name claimed mapSummaryToEntry mapping and SQL-path coverage
it doesn't exercise; the test only mocks repo.query with an already
projected result. Shortened the name to what it actually proves and moved
the removed context into a comment above the test.

The trading-order index migration's docstring wrongly stated bank_tx has
no created index. IDX_bank_tx_type_created on (type, created) already
exists for BankTxService.getBankTxFee, but only covers one of its three
sub-queries since type is the leading column. Corrected the paragraph
while keeping the underlying exclusion decision.

* docs: fix EXPLAIN date mismatch in trading-order index migration

The cited production EXPLAIN used created >= '2026-07-30', but the real
query (Util.firstDayOfMonth) always filters on the first of the month.
Replace the numbers with a measurement against the actual predicate
(created >= '2026-07-01'), note that scan cost is date-independent since
a Seq Scan reads the whole table regardless, and add an honest caveat
that the planner's index choice is not verified in production yet.

* docs: unify duplicate row-count figure in trading-order index migration

Line 39 quoted 123,831 matching rows from an earlier measurement while
line 22 quotes 123,918 from the EXPLAIN cited right above it. Align on
123,918 and note that the number is a point-in-time snapshot (the table
grows by roughly 4,350 rows/day) — the ~2.3% selectivity is the stable
figure the design decision rests on, not the absolute row count.
@TaprootFreak
TaprootFreak merged commit d4f7858 into main Jul 30, 2026
17 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant