Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
P
picodata
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Container Registry
Model registry
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
core
picodata
Commits
a7e85657
Verified
Commit
a7e85657
authored
2 years ago
by
Denis Smirnov
Browse files
Options
Downloads
Patches
Plain Diff
perf: clarify preallocation size for set distribution
parent
19fd9a7b
No related branches found
Branches containing commit
No related tags found
Tags containing commit
1 merge request
!1414
sbroad import
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
src/ir/distribution.rs
+3
-9
3 additions, 9 deletions
src/ir/distribution.rs
with
3 additions
and
9 deletions
src/ir/distribution.rs
+
3
−
9
View file @
a7e85657
...
...
@@ -131,17 +131,10 @@ impl Plan {
#[allow(clippy::too_many_lines)]
pub
fn
set_distribution
(
&
mut
self
,
row_id
:
usize
)
->
Result
<
(),
QueryPlannerError
>
{
let
row_expr
=
self
.get_expression_node
(
row_id
)
?
;
let
capacity
=
match
row_expr
{
Expression
::
Row
{
list
,
..
}
=>
list
.len
(),
_
=>
{
return
Err
(
QueryPlannerError
::
CustomError
(
"Expected Row expression"
.to_string
(),
))
}
};
let
capacity
=
row_expr
.get_row_list
()
?
.len
();
let
mut
child_set
:
HashSet
<
usize
>
=
HashSet
::
with_capacity
(
capacity
);
let
mut
child_pos_map
:
HashMap
<
(
usize
,
usize
),
usize
,
RandomState
>
=
HashMap
::
with_
capacity_and_hasher
(
capacity
,
RandomState
::
new
());
HashMap
::
with_
hasher
(
RandomState
::
new
());
let
mut
table_set
:
HashSet
<
String
>
=
HashSet
::
new
();
let
mut
table_pos_map
:
HashMap
<
usize
,
usize
,
RandomState
>
=
HashMap
::
with_hasher
(
RandomState
::
new
());
...
...
@@ -172,6 +165,7 @@ impl Plan {
let
child_pos_list
:
&
Vec
<
usize
>
=
targets
.as_ref
()
.ok_or
(
QueryPlannerError
::
InvalidReference
)
?
;
child_pos_map
.reserve
(
child_pos_list
.len
());
for
target
in
child_pos_list
{
let
child_node
:
&
usize
=
children
.get
(
*
target
)
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment