Batch number field lookups in Dirichlet character search columns (LMFDB#6008)#41
Open
roed-math wants to merge 1 commit into
Open
Batch number field lookups in Dirichlet character search columns (LMFDB#6008)#41roed-math wants to merge 1 commit into
roed-math wants to merge 1 commit into
Conversation
…DB#6008) The kernel field and value field columns each issued two database queries per row (nf_fields lookup by coefficients plus a nf_fields_extra lookup inside WebNumberField.from_coeffs/from_cyclo), about 200 round trips per 50-row results page. Add a postprocessing step to the search that computes all defining polynomials up front (the pari galoissubcyclo/polredabs computations take ~9ms per page) and finds the matching number field labels in a single nf_fields query; the column display functions use the precomputed labels and fall back to the old per-row behavior when they are absent. The batch query uses a top-level $or of equality clauses because psycodict's array $in path omits the ::numeric[] typecast that plain equality gets. Verified: rendered results tables byte-identical before/after on four sample searches; render time 29.3/29.5/14.4/24.6s -> 0.45/0.85/0.90/0.89s against devmirror; downloads unchanged by construction; 26 character tests pass (including a new test_field_columns); pyflakes clean. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
The kernel field and value field columns added in LMFDB#6004 issued two database queries per row
each (a
nf_fieldslookup by coefficients plus anf_fields_extralookup), roughly 200round trips per 50-row results page. This adds a postprocessing step to the search that
computes all defining polynomials up front and finds the matching number field labels in a
single
nf_fieldsquery; the column display functions use the precomputed labels (fallingback to the old per-row behavior if the data is absent). Profiling shows the pari
computations (galoissubcyclo/polredabs) take ~9ms per page, so the database round trips were
the entire cost, answering the question raised in the issue. Rendered search-results tables
are byte-identical before and after on sample searches, downloads are unchanged, and page
render time against a remote database drops from 14-30s to under 1s (16-65x). The batch
query uses
$orof equalities rather than$inbecause psycodict omits the::numeric[]typecast on the array-
$inpath.Addresses LMFDB#6008.
🤖 Generated with Claude Code