Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

IGNITE-22557 Create system view for SQL query plans history #11425

Open
wants to merge 34 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
34 commits
Select commit Hold shift + click to select a range
8652ad7
IGNITE-22557 Tests added
oleg-vlsk Jul 4, 2024
7485803
IGNITE-22557 SQL Plan History view introduced
oleg-vlsk Aug 2, 2024
2e4f27c
IGNITE-22557 SQL Plan History Configuration Test removed from ignite-…
oleg-vlsk Aug 2, 2024
95ab41b
IGNITE-22557 Tests added to IgniteCalciteTestSuite
oleg-vlsk Aug 2, 2024
318ffdf
IGNITE-22557 Tests minor refactoring
oleg-vlsk Aug 2, 2024
bfd9fe4
IGNITE-22557 Minor refactoring
oleg-vlsk Aug 2, 2024
21b5807
IGNITE-22557 Minor refactoring
oleg-vlsk Aug 2, 2024
40f2291
IGNITE-22557 Minor refactoring
oleg-vlsk Aug 2, 2024
adeefb5
IGNITE-22557 Minor UpdatePlan#plan refactoring
oleg-vlsk Aug 2, 2024
63831eb
IGNITE-22557 Sequence of columns in the view changed
oleg-vlsk Aug 2, 2024
91833e4
IGNITE-22557 SqlPlanHistoryH2SelfTest refactoring
oleg-vlsk Aug 5, 2024
27f46ab
IGNITE-22557 Description of the view added to system-views.adoc
oleg-vlsk Aug 5, 2024
a338ccd
IGNITE-22557 Tests refactoring, SqlPlanHistoryCalciteSelfTest#testEmp…
oleg-vlsk Aug 5, 2024
ed7380c
IGNITE-22557 Adding plans for DML commands moved from IgniteH2Indexin…
oleg-vlsk Aug 6, 2024
9cb98f9
IGNITE-22557 Changes made according to code review
oleg-vlsk Sep 10, 2024
febb24f
IGNITE-22557 Minor tests refactoring
oleg-vlsk Sep 10, 2024
1667294
IGNITE-22557 GridBoundedConcurrentLinkedHashMap changed to GridBounde…
Sep 25, 2024
8a437a2
IGNITE-22557 Whitespaces refactoring
Sep 25, 2024
886c763
IGNITE-22557 Whitespaces refactoring
Sep 25, 2024
657b86b
Delete changes in UpdatePlan
oleg-vlsk Sep 25, 2024
be4551a
Revert "Delete changes in UpdatePlan"
Sep 25, 2024
2177847
IGNITE-22557 Whitespaces refactoring
Sep 25, 2024
6bb9e06
IGNITE-22557 Whitespaces refactoring
Sep 25, 2024
776339b
IGNITE-22557 SqlPlanHistoryConfigTest moved to ignite-spring, SqlPlan…
Sep 29, 2024
5fa16ac
IGNITE-22557 GridBoundedConcurrentLinkedHashSet has been changed back…
Sep 29, 2024
e6eeaeb
IGNITE-22557 sqlEngine and isClient added as parameters to SqlPlanHis…
Sep 29, 2024
9a68a10
IGNITE-22557 other options for SqlPlanHistoryIntegrationTest#params
Sep 29, 2024
31faf0c
IGNITE-22557 SqlPlanHistoryIntegrationTest refactored, SqlPlanHistory…
Oct 3, 2024
2e6fdbe
IGNITE-22557 Javadoc for SqlPlanHistoryIntegrationTest corrected
Oct 3, 2024
850f43c
IGNITE-22557 SqlPlanHistoryIntegrationTest refactored
Oct 7, 2024
0454592
IGNITE-22557 Changes from master merged
Oct 7, 2024
183af7f
IGNITE-22557 Changes for failed tests
Oct 8, 2024
6ab7de6
IGNITE-22557 SqlPlanHistoryIntegrationTest refactored
oleg-vlsk Oct 8, 2024
9dd2cfc
Merge branch 'ignite-22557' of https://github.com/oleg-vlsk/ignite in…
oleg-vlsk Oct 8, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 15 additions & 0 deletions docs/_docs/monitoring-metrics/system-views.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -519,6 +519,21 @@ This view exposes information about currently running SQL queries.
|LAST_START_TIME | date | Last execution date
|===

== SQL_PLANS_HISTORY

This view displays a list of plans of previously executed SQL queries.

[{table_opts}]
|===
|NAME | TYPE | DESCRIPTION
|SCHEMA_NAME | string | Schema name
|SQL | string | Query text
|PLAN | string | SQL plan text
|LOCAL | boolean | True if local only
|ENGINE | string | SQL engine
|LAST_START_TIME | date | Last execution date
|===

== SCHEMAS

This view exposes information about SQL schemas.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -685,6 +685,14 @@ private ListFieldsQueryCursor<?> mapAndExecutePlan(
);
}

ctx.query().runningQueryManager().planHistoryTracker().addPlan(
plan.textPlan(),
qry.sql(),
qry.context().schemaName(),
qry.context().isLocal(),
CalciteQueryEngineConfiguration.ENGINE_NAME
);

QueryProperties qryProps = qry.context().unwrap(QueryProperties.class);

Function<Object, Object> fieldConverter = (qryProps == null || qryProps.keepBinary()) ? null :
Expand Down
Loading