Skip to content

Remove the dead column cache (#303) - #308

Merged
jdatcmd merged 1 commit into
mainfrom
fix/303-remove-dead-column-cache
Jul 31, 2026
Merged

Remove the dead column cache (#303)#308
jdatcmd merged 1 commit into
mainfrom
fix/303-remove-dead-column-cache

Conversation

@jdatcmd

@jdatcmd jdatcmd commented Jul 31, 2026

Copy link
Copy Markdown
Collaborator

Closes #303 and #282. Five-major matrix: ALL VERSIONS PASSED.

The decision

Removed rather than re-wired, and the argument is not "it is unused". It is that
this is not a wire to reconnect. The code was written against the on-disk
format Phase H2 deleted; the current native reader decompresses on a different
path. Restoring the behaviour means writing a new integration and making the
performance case again from scratch. Its value now is as a design sketch, which
the git history keeps. #289's vectorized decompression work would shape any future
caching layer far more than this code would.

What was actually wrong

ColumnarGetDecompressedStream had zero callers since 22 July. What ran was
ColumnarCacheInit from _PG_init, which is the entire 6.7% line coverage #282
asked about.

Two GUCs and four documentation passages described a feature that did nothing. A
user could set pgcolumnar.enable_column_cache, read the administration guide,
and reasonably believe they had enabled something.

The tests deserve naming

phase6.sh had three cache assertions and all three passed on a dead cache.
They compared results with the cache on against the cache off and asserted the two
were equal, which is trivially true when both are the same path. One claimed in
its comment to "exercise LRU eviction"; columnar_lru_evict has never run.

Removed with the feature, and the comment left in their place says what a
replacement would have to assert: a hit that is observable, and an eviction that
evicts. A correctness-only comparison cannot distinguish a working cache from an
absent one.

User-visible

A postgresql.conf that sets either parameter must drop the line, or the server
will reject an unrecognised pgcolumnar.* parameter. Recorded in the CHANGELOG
under a new Removed heading. Pre-release, no compatibility guarantee, and
neither setting did anything.

Scope

src/columnar_cache.c deleted, both GUCs and the header block removed, the
Makefile object dropped, phase6.sh assertions removed, and
configuration.md, administration.md, ARCHITECTURE.md and testing.md
corrected. Docs pass the style gate.

@ChronicallyJD

Copy link
Copy Markdown
Collaborator

Reviewed and verified on pg18a (assert). The removal is clean and the reasoning is right — this is dead code from the H2 format change, not a wire to reconnect.

Verified:

  • ColumnarGetDecompressedStream has zero callers on main (only ColumnarCacheInit ran, from _PG_init) — confirms the dead-code case.
  • columnar_cache.c fully removed, no dangling references to any cache symbol in src/ or the Makefile, build clean.
  • phase6 and smoke pass. Agreed on the phase6 point — a cache-on-vs-cache-off equality check can't tell a working cache from an absent one; the replacement-guidance comment is the right thing to leave behind.

One accuracy fix for the body/CHANGELOG. The removed GUC doesn't reject startup. With MarkGUCPrefixReserved("pgcolumnar"), a postgresql.conf that still sets pgcolumnar.enable_column_cache starts with a warning and drops the setting — it does not fail to start:

WARNING:  invalid configuration parameter name "pgcolumnar.enable_column_cache", removing it
DETAIL:  "pgcolumnar" is now a reserved prefix.

So "must drop the line, or the server will reject an unrecognised pgcolumnar.* parameter" overstates it — the server runs; the stale line is ignored with a warning. Worth softening so an operator doesn't expect a failed start. Otherwise LGTM.

@jdatcmd
jdatcmd force-pushed the fix/303-remove-dead-column-cache branch from ad99145 to 8730b6c Compare July 31, 2026 22:34
The cache had not run since 22 July. ColumnarGetDecompressedStream, its only
entry point, had no callers: Phase H2 removed the old on-disk format and took the
call site with it, and nothing since put one back. What executed was
ColumnarCacheInit from _PG_init, which is the whole of the 6.7% line coverage
that #282 asked about.

Two settings and four passages of documentation described a feature that did
nothing. A user could set pgcolumnar.enable_column_cache, read the administration
guide, and reasonably believe they had turned something on.

Removed rather than re-wired, and the reason is that this is not a wire to
reconnect. The code was written against the format H2 deleted; the current native
reader decompresses on a different path, so restoring the behaviour means writing
a new integration and making the performance case again. Its value now is as a
design sketch, and the git history keeps that. #289's vectorized decompression
work would shape any future caching layer more than this code would.

The three assertions in phase6.sh go with it, and they are worth naming. They
compared query results with the cache on against the cache off and asserted the
two were equal, and one claimed in its comment to exercise LRU eviction. All
three passed against a cache that did nothing, because a correctness-only
comparison between two identical paths cannot fail. columnar_lru_evict has never
run. That is the same shape as an empty REGRESS reporting success.

A postgresql.conf that sets either parameter must drop the line, which the
CHANGELOG records under Removed. Pre-release, no compatibility guarantee, and
neither setting did anything.

Five-major matrix: ALL VERSIONS PASSED.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
@jdatcmd
jdatcmd force-pushed the fix/303-remove-dead-column-cache branch from 8730b6c to 0ad4ed4 Compare July 31, 2026 22:45
@jdatcmd
jdatcmd merged commit 8053e8c into main Jul 31, 2026
11 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.

The column cache is dead code: its only entry point has no callers, and three tests pass because of it

2 participants