phoenix-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "James Taylor (JIRA)" <>
Subject [jira] [Commented] (PHOENIX-2143) Use guidepost bytes instead of region name in stats primary key
Date Tue, 01 Dec 2015 18:57:11 GMT


James Taylor commented on PHOENIX-2143:

Sorry for the confusion, [~maryannxue]. [~ankit.singhal] started work on a related issue (PHOENIX-2249)
which is actually not necessary if we do this one, so I thought if he has time, he could do
this one instead. Either way, though, it'd be much appreciated if you have time to review
the proposed solution and make sure it's going to work to improve the cost estimations in
the Phoenix/Calcite integration.

> Use guidepost bytes instead of region name in stats primary key
> ---------------------------------------------------------------
>                 Key: PHOENIX-2143
>                 URL:
>             Project: Phoenix
>          Issue Type: Sub-task
>            Reporter: James Taylor
>            Assignee: Ankit Singhal
> Our current SYSTEM.STATS table uses the region name as the last column in the primary
key constraint. Instead, we should use the MIN_KEY column (which corresponds to the region
start key). The advantage would be that the stats would then be ordered by region start key
allowing us to approximate the number of guideposts which would be traversed given the start/stop
row of a scan:
> {code}
> SELECT SUM(guide_posts_count) FROM SYSTEM.STATS WHERE min_key > :1 AND min_key <
> {code}
> where :1 is the start row and :2 is the stop row of the scan. With an UNNEST operator
for ARRAYs, we could get a better approximation.
> As part of the upgrade to the new Phoenix version containing this fix, stats could simply
be dropped and they'd be recalculated with the new schema.
> An alternative, even more granular approach would be to *not* use arrays to store the
guide posts, but instead store them as individual rows with a schema like this.
> In this alternative, the maintenance during compaction is higher, though, as you'd need
to run a separate query to do the deletion of the old guideposts, followed by a commit of
the new guideposts. The other disadvantage (besides requiring multiple queries) is that this
couldn't be done transactionally.

This message was sent by Atlassian JIRA

View raw message