feat(sql): add table_min_ and table_max_timestamp columns to tables() view#6630
Merged
bluestreak01 merged 4 commits intomasterfrom Jan 13, 2026
Merged
feat(sql): add table_min_ and table_max_timestamp columns to tables() view#6630bluestreak01 merged 4 commits intomasterfrom
bluestreak01 merged 4 commits intomasterfrom
Conversation
|
Important Review skippedAuto reviews are disabled on this repository. Please check the settings in the CodeRabbit UI or the You can disable this status message by setting the Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
Contributor
[PR Coverage check]😍 pass : 55 / 58 (94.83%) file detail
|
glasstiger
approved these changes
Jan 13, 2026
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.
Documentation PR: questdb/documentation#323
Summary
This PR adds
table_min_timestampandtable_max_timestampcolumns to thetables()function, which expose the actual data timestamp range in each table. These values are updated when WAL transactions are merged into tables and during startup hydration.Changes
New columns in
tables():table_min_timestamp- Minimum timestamp of data in the tabletable_max_timestamp- Maximum timestamp of data in the tableRenamed columns for clarity:
table_max_timestamp→table_last_write_timestamp(timestamp of last TableWriter commit, not data timestamp)dedup_row_count_since_start→wal_dedup_row_count_since_start(consistentwal_prefix)Column reordering:
The new timestamp columns are placed just before
table_last_write_timestamp:Implementation Details
TableWriter.java: Added publicgetMinTimestamp()methodRecentWriteTracker.java:tableMinTimestamp/tableMaxTimestampfields toWriteStatsrecordMergeStats()to capture timestamps during WAL applyrecordWriteIfAbsent()to capture timestamps during startup hydrationtimestampparameter towriteTimestampfor clarityApplyWal2TableJob.java: Passes min/max timestamps torecordMergeStats()CairoEngine.java: Passes min/max timestamps during tracker hydrationTablesFunctionFactory.java: Added new columns and updated column indicesTest plan
ShowTablesTestandTablesFunctionFactoryTestupdated and passingRecentWriteTrackerTestupdated to verify timestamp captureSELECT table_name, table_min_timestamp, table_max_timestamp FROM tables()🤖 Generated with Claude Code