-
Notifications
You must be signed in to change notification settings - Fork 647
Added parameter selectivity and boosted LookupJoin #6874
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
Merged
Merged
Changes from all commits
Commits
Show all changes
2 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
{ | ||
"op_name": "LeftJoin (MapJoin)", | ||
"args": [ | ||
{ | ||
"op_name": "LeftJoin (MapJoin)", | ||
"args": [ | ||
{ | ||
"op_name": "LeftJoin (MapJoin)", | ||
"args": [ | ||
{ | ||
"op_name": "TableFullScan", | ||
"table": "quotas_browsers_relation" | ||
}, | ||
{ | ||
"op_name": "TableLookup", | ||
"table": "browsers" | ||
} | ||
] | ||
}, | ||
{ | ||
"op_name": "TableLookup", | ||
"table": "browser_groups" | ||
} | ||
] | ||
}, | ||
{ | ||
"op_name": "TableFullScan", | ||
"table": "quota" | ||
} | ||
] | ||
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
DECLARE $quotaName as Utf8?; | ||
DECLARE $browserGroup as Utf8?; | ||
DECLARE $limit as Uint32; | ||
DECLARE $offset as Uint32; | ||
PRAGMA TablePathPrefix ="/Root/"; | ||
|
||
$browsers = ( | ||
SELECT | ||
b.id as id, | ||
q.name AS quota_name, | ||
b.name AS name, | ||
b.version AS version, | ||
b.group AS group, | ||
b.description AS description, | ||
bg.browser_platform AS platform, | ||
MAX_OF(qb.created_at, b.created_at) AS created_at, | ||
qb.deleted_at AS deleted_at | ||
FROM | ||
quotas_browsers_relation AS qb | ||
LEFT JOIN | ||
browsers AS b | ||
ON qb.browser_id = b.id | ||
LEFT JOIN | ||
browser_groups AS bg | ||
ON | ||
b.group = bg.name | ||
LEFT JOIN | ||
quota as q | ||
ON | ||
qb.quota_id = q.id | ||
WHERE | ||
( | ||
($quotaName IS NOT NULL AND q.name = $quotaName) OR | ||
$quotaName IS NULL ) AND | ||
( ($browserGroup IS NOT NULL AND b.group = $browserGroup) OR $browserGroup IS NULL | ||
) AND ( group IS NOT NULL )); | ||
|
||
SELECT * FROM $browsers ORDER BY created_at LIMIT $limit OFFSET $offset; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,46 @@ | ||
CREATE TABLE `/Root/quotas_browsers_relation` ( | ||
quota_id Utf8, | ||
browser_id Utf8, | ||
id Utf8, | ||
created_at Timestamp, | ||
deleted_at Timestamp, | ||
primary key (quota_id, browser_id) | ||
); | ||
|
||
CREATE TABLE `/Root/browsers` ( | ||
id Utf8, | ||
name Utf8, | ||
version Utf8, | ||
group Utf8, | ||
created_at Timestamp, | ||
deleted_at Timestamp, | ||
description Utf8, | ||
primary key (id) | ||
); | ||
|
||
CREATE TABLE `/Root/browser_groups` ( | ||
name Utf8, | ||
platform Utf8, | ||
sessions_per_agent_limit Uint32 , | ||
cpu_cores_per_session Double , | ||
ramdrive_gb_per_session Double , | ||
ram_gb_per_session Double , | ||
ramdrive_size_gb Double , | ||
session_request_timeout_ms Uint32 , | ||
browser_platform Utf8 , | ||
service_startup_timeout_ms Uint32 , | ||
session_attempt_timeout_ms Uint32, | ||
primary key (name) | ||
); | ||
|
||
CREATE TABLE `/Root/quota` ( | ||
name Utf8, | ||
created_at Timestamp , | ||
owner Utf8 , | ||
agents_max_limit Uint32 , | ||
agent_kill_timeout_ms Uint32 , | ||
agent_queue_time_limit_ms Uint32 , | ||
agent_secret_id Utf8 , | ||
id Utf8 , | ||
primary key(name) | ||
); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
{ | ||
"/Root/quotas_browsers_relation": { | ||
"n_rows": 222, | ||
"byte_size": 28140 | ||
}, | ||
"/Root/browsers": { | ||
"n_rows": 87, | ||
"byte_size": 26719 | ||
}, | ||
"/Root/browser_groups": { | ||
"n_rows": 17, | ||
"byte_size": 1905 | ||
}, | ||
"/Root/quota": { | ||
"n_rows": 55, | ||
"byte_size": 9241 | ||
} | ||
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
А почему тут поменялось количество чтений?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Стало больше, но тут приграничная история, был 1 lookup и 1 map, так и осталось, просто таблицы другие