-
Notifications
You must be signed in to change notification settings - Fork 112
implement area size heuristic for area:id queries #364
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
base: master
Are you sure you want to change the base?
Changes from 1 commit
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -287,8 +287,20 @@ void Area_Query_Statement::get_ranges | |
|
|
||
| bool Area_Constraint::delivers_data(Resource_Manager& rman) | ||
| { | ||
| int counter = 0; | ||
|
|
||
| if (!area->areas_from_input()) | ||
| return false; | ||
| { | ||
| Block_Backend< Uint31_Index, Area_Skeleton > area_locations_db | ||
| (rman.get_area_transaction()->data_index(area_settings().AREAS)); | ||
| for (Block_Backend< Uint31_Index, Area_Skeleton >::Flat_Iterator | ||
| it(area_locations_db.flat_begin()); | ||
| !(it == area_locations_db.flat_end()); ++it) | ||
| { | ||
| if (area->get_submitted_id() == it.object().id.val()) | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Can you check if you could use it.handle() ... instead to get the id (avoids some unneeded object instatiation) - not super urgent.
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. you mean just changing it to It probably should also be changed on line 244…
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I had
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. ah, yes, that makes more sense 🙈 -> 4d9992d
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I think even the .val() at the end is not needed as id() already returns the right type. Can you maybe test this again?
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Then I get the following compile-time error (gcc 6.2):
Uint32_Index has the == operator implemented only for comparing with other Uint32_Index values while Area_Query_Statement (for some reason) stores the id it gets in a 64bit integer. But I think that calling
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Ok, fine, let's keep val(). I didn't have the source available when commenting and didn't exactly remember when it was necessary. |
||
| counter += it.object().used_indices.size(); | ||
| } | ||
| } | ||
| else | ||
| { | ||
| map< string, Set >::const_iterator mit = rman.sets().find(area->get_input()); | ||
|
|
@@ -305,8 +317,8 @@ bool Area_Constraint::delivers_data(Resource_Manager& rman) | |
| counter += it2->used_indices.size(); | ||
| } | ||
|
|
||
| return (counter <= 12); | ||
| } | ||
| return (counter <= 12); | ||
| } | ||
|
|
||
|
|
||
|
|
||
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.
int counter = 0in line 311 should probably be removed as well, otherwise line 321 won't return the correct value I guess (variablecountergets shadowed).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.
right! forgot to remove that one