Skip to content

Index advisor prototype#81923

Closed
FArthur-cmd wants to merge 12 commits intoClickHouse:masterfrom
FArthur-cmd:index_advisor
Closed

Index advisor prototype#81923
FArthur-cmd wants to merge 12 commits intoClickHouse:masterfrom
FArthur-cmd:index_advisor

Conversation

@FArthur-cmd
Copy link
Copy Markdown
Contributor

@FArthur-cmd FArthur-cmd commented Jun 16, 2025

Changelog category (leave one):

  • Experimental Feature

Changelog entry (a user-readable short description of the changes that goes to CHANGELOG.md):

Add support for Index advisor. This structure recommends indexes and primary keys for collected workload (special START/FINISH COLLECTING WORKLOAD keywords)

Documentation entry for user-facing changes

  • Documentation is written (mandatory for new features)

Description of code

All queries executed after START COLLECTING WORKLOAD are written into file. When FINISH COLLECTING WORKLOAD is called, all queries will be read by algorithm. For each query it determines kind of query (we need to optimise select queries, but some queries may depend on views that were created and removed in workload, so we store them too). All columns, that are used in queries are collected and matched with tables. Then we execute search for pk or skip index. Algorithms are described fully in docs (just extract number of read marks using EXPLAIN ESTIMATE for each query). Finally, results are shown to user as a table.

@rschu1ze rschu1ze mentioned this pull request Jun 16, 2025
1 task
@FArthur-cmd FArthur-cmd changed the title [WIP] Index advisor prototype Index advisor prototype Jun 24, 2025
@FArthur-cmd FArthur-cmd marked this pull request as ready for review June 24, 2025 21:41
@clickhouse-gh
Copy link
Copy Markdown
Contributor

clickhouse-gh bot commented Jun 25, 2025

Workflow [PR], commit [db1d587]

Summary:
15 failures out of 116 shown:

job_name test_name status info comment
Config Workflow failure
can_be_trusted failure
Dockers Build (amd) dropped
Dockers Build (arm) dropped
Style check dropped
Docs check dropped
Fast test dropped
Build (amd_tidy) dropped
Build (arm_tidy) dropped
Build (amd_debug) dropped
Build (amd_release) dropped
Build (amd_asan) dropped
Build (amd_tsan) dropped
Build (amd_msan) dropped
Build (amd_ubsan) dropped
Build (amd_binary) dropped

@clickhouse-gh clickhouse-gh bot added the pr-experimental Experimental Feature label Jun 25, 2025
@@ -0,0 +1,125 @@
# Index Advisor ⚠️ Experimental
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice documentation!

{
}

IndexTypes getBestMinMaxIndexForTable(const String & table);
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

getBestSkipIndexForTable?

@FArthur-cmd FArthur-cmd changed the title Index advisor prototype [WIP] Index advisor prototype Jun 27, 2025
@FArthur-cmd FArthur-cmd changed the title [WIP] Index advisor prototype Index advisor prototype Jun 27, 2025
@alexey-milovidov alexey-milovidov added the close in a month if not active This will be closed in case of no information label Oct 17, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

close in a month if not active This will be closed in case of no information pr-experimental Experimental Feature

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants