Skip to content

Conversation

@morningman
Copy link
Contributor

bp (#33928)

…id (apache#33928)

In previously, all statistic tables have a column named `id`.
This column is combined with `tableId` and `indexId`.
Because table's id is unique globally, so we can query statistic table by only `id`
to fetch the table's statistic data.

By for external table, the table's id may not be unique globally. For example, the table id
may only be unique within a database. So we need more predicates to fetch the right statistic data.

In this PR, I changed all query statements of statistic table, by adding `catalog_id` and `database_id` conditions.
For example:

```
SELECT * FROM 
column_statistics
WHERE `id` = '${id}' AND `catalog_id` = '${catalogId}' AND `db_id` = '${dbId}'
```

The content of `id` column in statistic tables remain unchanged, so that after user upgrade Doris,
the existing statistic data can still be used.
@doris-robot
Copy link

Thank you for your contribution to Apache Doris.
Don't know what should be done next? See How to process your PR

Since 2024-03-18, the Document has been moved to doris-website.
See Doris Document.

@morningman morningman merged commit 4b97720 into apache:branch-2.1 Apr 27, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants