Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 10 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -130,6 +130,16 @@ unreleased. For the forward-looking plan see
- Lost delete marks under concurrent same-chunk-group deletes.
- Relation-reference leak in parallel `CREATE INDEX`.

### Removed

- The decompressed-chunk cache, and the `pgcolumnar.enable_column_cache` and
`pgcolumnar.column_cache_size` settings with it. Its only entry point had lost
its caller when the earlier on-disk format was removed, so the cache had done
nothing since. Two settings and four passages of documentation described a
feature that did not run. A `postgresql.conf` that sets either parameter must
drop the line. The implementation is in the git history if the performance case
is made again against the current reader.

### Changed

- FSST string encoding is now kept only when it reduces the compressed chunk by
Expand Down
1 change: 0 additions & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@ OBJS = \
src/columnar_reader.o \
src/columnar_delete_vector.o \
src/columnar_customscan.o \
src/columnar_cache.o \
src/columnar_vector.o \
src/columnar_vacuum.o \
src/columnar_unique.o \
Expand Down
13 changes: 2 additions & 11 deletions docs/ARCHITECTURE.md
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ storage, bulk and single insert, sequential scan open/next/close, delete and
update (through the row mask), fetch a row by item pointer, size estimation, and
truncate. It also holds `_PG_init`, which registers every `pgcolumnar.*` GUC (the
compression codec and level, the row-group and vector row limits, and the qual
pushdown, custom scan, vectorized aggregate, and column cache toggles), the
pushdown, custom scan and vectorized aggregate toggles), the
pre-commit hook that flushes pending writes, and the object-access hook that
removes a table's metadata rows when the table is dropped.

Expand Down Expand Up @@ -208,15 +208,6 @@ answered from the zone-map metadata, falling back to a scan-and-fold when the
group has deletes. It is chosen only when every aggregate, column type, and
clause is supported; anything else falls back to the scalar plan.

### columnar_cache.c
The optional decompressed-chunk cache, off by default behind
`pgcolumnar.enable_column_cache` and bounded by `pgcolumnar.column_cache_size`
megabytes. It is a backend-local, LRU-bounded cache of decompressed value
streams keyed by storage id and absolute logical offset. It returns a fresh copy
to the caller so eviction is always safe, and it is flushed on any relcache
invalidation so a truncate offset reuse or a vacuum storage swap can never serve
a stale buffer. It only avoids repeated decompression; it never changes results.

### columnar_vacuum.c
Compaction, statistics, and storage-id lookup. `pgcolumnar.vacuum` materializes a
relation's live rows (the reader skips row-mask-deleted rows), swaps the
Expand Down Expand Up @@ -373,7 +364,7 @@ Scan:
2. The reader (`columnar_reader`) goes through the row groups. It uses the zone
maps in `columnar_metadata` to skip groups and vectors.
3. The reader decodes the projected chunks through `columnar_encoding` and
`columnar_compression`, and can use `columnar_cache`.
`columnar_compression`.
4. The reader applies the delete vector (`columnar_delete_vector`) and returns
the rows one at a time.
5. The executor applies the full qual again, as a filter.
Expand Down
8 changes: 3 additions & 5 deletions docs/administration.md
Original file line number Diff line number Diff line change
Expand Up @@ -205,11 +205,9 @@ specific reason to change it.

## Column cache

`pgcolumnar.enable_column_cache` keeps chunk groups after decompression. Other
reads can then use them again. `pgcolumnar.column_cache_size` sets the size, and
the default is 200 MB. The cache is off by default. Enable it if you scan the
same recent data more than one time. Set the size to the size of the working
set.
There is no cache of decompressed chunk groups. A cache existed in an earlier
build, but its only entry point lost its caller and the code did nothing. It was
removed in #303 rather than left as a setting that changes nothing.

## Backup and restore

Expand Down
2 changes: 0 additions & 2 deletions docs/configuration.md
Original file line number Diff line number Diff line change
Expand Up @@ -69,8 +69,6 @@ disk. It never changes the values that a table returns.

| Setting | Type | Default | Description |
| --- | --- | --- | --- |
| `pgcolumnar.enable_column_cache` | boolean | `off` | Cache decompressed chunk groups so they can be reused across reads. |
| `pgcolumnar.column_cache_size` | integer (MB) | `200` | Size of the decompressed-chunk cache. Applies when the column cache is enabled. Range 1 to INT_MAX. |

### Maintenance and disk reclaim

Expand Down
2 changes: 1 addition & 1 deletion docs/testing.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ test/phase2.sh /path/to/pg_config # compression, projection, min/max skip, fi
test/phase3.sh /path/to/pg_config # delete, update, MVCC, savepoints, temp tables
test/phase4.sh /path/to/pg_config # btree/hash indexes, constraints, conversion
test/phase5.sh /path/to/pg_config # custom scan, pushdown, options, vacuum
test/phase6.sh /path/to/pg_config # aggregate correctness and the column cache
test/phase6.sh /path/to/pg_config # aggregate correctness
test/audit.sh /path/to/pg_config # regression tests for audited defects
test/concurrency.sh /path/to/pg_config # concurrent same-chunk-group deletes
test/unique_conc.sh /path/to/pg_config # concurrent same-unique-key inserts
Expand Down
16 changes: 0 additions & 16 deletions src/columnar.h
Original file line number Diff line number Diff line change
Expand Up @@ -173,11 +173,9 @@ extern bool columnar_enable_bloom_filter; /* bloom equality skipping (I7) */

/* Phase 6 GUCs (spec 8.3) */
extern bool columnar_enable_vectorization; /* vectorized aggregate path */
extern bool columnar_enable_column_cache; /* decompressed-chunk cache */
extern bool columnar_enable_read_stream; /* stream/prefetch block reads (PG17+) */
extern bool columnar_enable_index_only_scan; /* allow index-only scans (gap 28) */
extern bool columnar_enable_projection_scan; /* scan a covering projection (gap 26) */
extern int columnar_column_cache_size; /* cache budget in megabytes */

/* issue #5: concurrent unique-key insert serialization */
extern bool columnar_enable_unique_lock; /* serialize same-key inserters */
Expand Down Expand Up @@ -741,20 +739,6 @@ extern char *ColumnarDecompressValueStream(const char *comp, uint32 compLen,
int compressionType, uint32 rawLen,
MemoryContext targetContext);

/* -------------------------------------------------------------------------
* decompressed-chunk cache (columnar_cache.c, spec 8.3, 9)
*
* An optional, backend-local cache of decompressed value streams, keyed by the
* relation's storage id and the stream's absolute logical offset (both stable
* and never reused within a storage id, except across a truncate, which fires a
* relcache invalidation that flushes the whole cache). Off by default; when on
* it only avoids repeated decompression and never changes results.
* ------------------------------------------------------------------------- */
extern void ColumnarCacheInit(void);
extern char *ColumnarGetDecompressedStream(uint64 storageId, uint64 absOffset,
const char *comp, uint32 compLen,
int compressionType, uint32 rawLen,
MemoryContext targetContext);

/* -------------------------------------------------------------------------
* concurrent unique-key insert serialization (columnar_unique.c, issue #5)
Expand Down
240 changes: 0 additions & 240 deletions src/columnar_cache.c

This file was deleted.

Loading
Loading