model-writtenrun 3122 - may be wrong, links go to the source messages. Commit-by-commit LLM analysis is in the Commits dialog.
- Nikita Glukhov proposed B-tree nearest-neighbor searches in #1, using simultaneous forward and backward scans from the target value, selecting the nearer tuple at each step, and falling back to one direction when the target lies outside the scan range.
- The original series extracted scan state, moved scalar distance operators from btree_gist into core, and introduced an access-method callback; Alexander Korotkov requested a more extensible ordering interface and ordinary ALTER OPERATOR FAMILY migration commands in #4.
- Robert Haas supported reconsidering the interface and warned against casts hiding callback mismatches in #5 and #7, while Tom Lane warned that opaque callbacks could duplicate planner knowledge and conceal index capabilities in #6; unresolved design questions led to deferral in #9.
- After the long gap, Nikita returned with #10, replacing the callback with ammatchorderby() over PathKey lists, adding parallel kNN scans, and introducing the non-key-column cache lookup fix that would eventually land.
- Review of the rebased series identified extension-upgrade compatibility problems, incorrect volatility and leakproof declarations, and redundant scan-key processing in #13, #14, #15, and #16; Nikita addressed these in #17, retaining C wrappers for older btree_gist installations.
- Nikita extended the proposal in #19 to distance ordering on later index columns when preceding columns have equality restrictions, and added experimental mixed column/distance ordering with array keys, while acknowledging that its planner representation needed further work.
- Thomas Munro identified malformed SGML tags in #20, leading to documentation repairs in #21, and Nikita then corrected an experimental costing bug causing intermittent brin test failures in #22.
- Anastasia Lubennikova reported successful testing, explicitly approved the cache lookup prerequisite, and suggested readability improvements in #23; Nikita incorporated comment, scan-state, and distance-value handling changes in #24.
- Alexander questioned backward execution and descending array-key ordering in #25; Nikita's #26 disabled unsupported backward distance scans, added cursor tests, corrected array-key matching, fixed parallel scan initialization, and separated executor support into its own patch.
- After further rebases, Thomas reported missing distance-function declarations in #31, and Alexander argued that mixed ordering was too complex for an initial landing in #32; Nikita's #33 fixed the build and separated a simple first-column implementation using a boolean capability flag from the advanced callback-based features.
- Alexander took over rebasing while Nikita was on vacation in #36, preserving Nikita's authorship and proposing the basic-feature portion for eventual commitment.
- Alvaro Herrera questioned the cache lookup prerequisite in #37, and Alexander explained in #38 that GiST INCLUDE columns could already cause reads beyond the opclass vector; he committed that prerequisite from #36 as 7e04160390, simplifying the guard, adding an assertion, and backpatching through PostgreSQL 12.
- Alexander resent seven remaining basic-feature patches in #39, explicitly postponing the advanced-ordering patches and requesting clearer scan-state documentation and forward/backward state naming.
- The five-patch revision in #40 consolidated operator migration and tests, clarified scan-state pointers, and made btree_gist non-relocatable because its schema-qualified migration required @extschema@, leaving that extension-policy question open.
- Alexander rebased and refactored the series again in #41, and confirmed in response to Peter Geoghegan that the implementation changed scanning strategy without changing the B-tree on-disk format in #43.
- Alexander returned the feature with feedback in #44, concluding that merging two scans belonged above the B-tree access method, while a priority-queue traversal inside B-tree could support richer ordering but required substantially more work.
- Anton A. Melnikov revived the existing implementation in #45 after nearly four years, rebasing it as a development baseline and initially planning to implement the higher-level two-scan approach.
- Anton reported in #47 that the existing patch roughly halved execution time against btree_gist in his benchmark, but his MergeAppend experiment added overhead; he reconsidered the higher-level approach and highlighted descending-distance ordering as another reason to investigate a priority-queue design.
- Anton's latest attachment, #48, rebased the existing implementation again but reported an unresolved array-key interaction where a distance-ordered query returned only one of two expected rows.
- At the thread's last message, #49, Kirill Reshke moved the feature to another commitfest because of limited activity; only the cache lookup prerequisite had landed, while the kNN feature, its architectural redesign, and the reported missing-row issue remained unresolved.