Patent ID: 11880366
Assignee: SAP SE
Field: Computer technology (Electrical engineering)
Classification: CPC G | IPC G

Claim 15:
16. One or more non-transitory computer storage devices storing computer-executable instructions for estimating join size, the estimating comprising:
for a join operation between a first table and a second table, the join operation being associated with executing a received query, applying a filter to the first table and generating a filter output;
performing index-based sampling, comprising:
sampling the filter output to generate a filtered sample, the filtered sample comprising a plurality of records from the filter output; and
for the plurality of records in the filtered sample, accessing an index for the second table and retrieving counts of records in the second table corresponding to the plurality of records in the filtered sample;

calculating a join factor for the join operation based on the counts of records in the second table corresponding to the plurality of records in the filtered sample;
upon determining that a target statistical confidence for the join factor has not been reached, performing one or more iterations until the target statistical confidence is reached, the iterations comprising:
performing the index-based sampling again;
recalculating the join factor; and
assessing the statistical confidence for the recalculated join factor;

estimating a data size for the join operation using the join factor; and
ordering the join operation in a query execution plan for the received query based on the estimated data size.