Skip to content

Speed up sys segments per datasource queries - #19729

Draft
jtuglu1 wants to merge 2 commits into
apache:masterfrom
jtuglu1:speed-up-sys-segments-per-datasource-queries
Draft

Speed up sys segments per datasource queries#19729
jtuglu1 wants to merge 2 commits into
apache:masterfrom
jtuglu1:speed-up-sys-segments-per-datasource-queries

Conversation

@jtuglu1

@jtuglu1 jtuglu1 commented Jul 23, 2026

Copy link
Copy Markdown
Contributor

Description

Fixed the bug ...

Renamed the class ...

Added a forbidden-apis entry ...

Release note


Key changed/added classes in this PR
  • MyFoo
  • OurBar
  • TheirBaz

This PR has:

  • been self-reviewed.
  • added documentation for new or modified features or behaviors.
  • a release note entry in the PR description.
  • added Javadocs for most classes and all non-trivial methods. Linked related entities via Javadoc links.
  • added or updated version, license, or notice information in licenses.yaml
  • added comments explaining the "why" and the intent of the code wherever would not be obvious for an unfamiliar reader.
  • added unit tests or modified existing tests to cover new code paths, ensuring the threshold for code coverage is met.
  • added integration tests.
  • been tested in a test Druid cluster.

* output. Per-datasource read authorization is applied here so results match a scan of
* {@code sys.segments}.
*/
public class SegmentsRollupRel extends AbstractRelNode implements BindableRel
)
{
super(
operand(Aggregate.class, operand(Project.class, operand(TableScan.class, none()))),
)
{
super(
operand(Aggregate.class, operand(Project.class, operand(TableScan.class, none()))),
)
{
super(
operand(Aggregate.class, operand(Project.class, operand(TableScan.class, none()))),
)
{
super(
operand(Aggregate.class, operand(Project.class, operand(TableScan.class, none()))),
// segment. In that case, we use numRows from the segment polled from the Coordinator.
numRows = val.getNumRows();
} else if (available != null) {
numRows = available.getNumRows();
static DerivedSegmentStatus forAvailable(final AvailableSegmentMetadata val)
{
final DataSegment segment = val.getSegment();
final long numRows = segment.getTotalRows() != null ? segment.getTotalRows() : val.getNumRows();
* This table contains row per segment from metadata store as well as served segments.
*/
static class SegmentsTable extends AbstractTable implements ProjectableFilterableTable
static class SegmentsTable extends AbstractTable implements ProjectableFilterableTable, SegmentsRollupSource
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants