Bug 493256 - Improve query performance for filtering based on constant literals
Summary: Improve query performance for filtering based on constant literals
Status: RESOLVED FIXED
Alias: None
Product: Viatra
Classification: Modeling
Component: Query (show other bugs)
Version: 1.2.0   Edit
Hardware: All All
: P3 enhancement
Target Milestone: 1.5.0M1   Edit
Assignee: Gabor Bergmann CLA
QA Contact:
URL:
Whiteboard:
Keywords: performance
Depends on:
Blocks: 398763
  Show dependency tree
 
Reported: 2016-05-09 11:31 EDT by Gabor Bergmann CLA
Modified: 2016-12-01 03:03 EST (History)
0 users

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Gabor Bergmann CLA 2016-05-09 11:31:54 EDT
Currently, constant literals are mapped to a unary relation which is then joined against a partial match set. Suggested improvements:

 - Rete implementation: introduce a ValueMultiplexer node that multiplexes input tuples to child nodes based on the tuple value at a given position. A child node can be registered for each concrete constant value of that variable. Both kinds of nodes will be memoryless, and tuple propagation cost will not increase by the number of different constant values used at the given position.

 - Query planning: make sure that constant filtering takes precedence over non-constant joins (even heath-joins)
Comment 1 Zoltan Ujhelyi CLA 2016-05-26 08:37:16 EDT
Updated target milestone to 1.4
Comment 2 Gabor Bergmann CLA 2016-05-27 03:45:27 EDT
Further improvement:

 - Query planning: in case of negative calls, apply constant filter to the negatively called pattern before anti-joining it, if the constant variable is not shared with other other constraints (besides the NAC and the constant constraint).
Comment 3 Gabor Bergmann CLA 2016-05-27 10:58:17 EDT
(the previous idea applies for aggregation as well)
Comment 4 Abel Hegedus CLA 2016-09-06 10:14:04 EDT
Postponing issues to 1.5
Comment 5 Eclipse Genie CLA 2016-09-23 10:42:50 EDT
New Gerrit change created: https://git.eclipse.org/r/81800
Comment 6 Eclipse Genie CLA 2016-09-30 12:10:57 EDT
New Gerrit change created: https://git.eclipse.org/r/82293
Comment 8 Eclipse Genie CLA 2016-10-28 04:33:07 EDT
New Gerrit change created: https://git.eclipse.org/r/84079
Comment 9 Eclipse Genie CLA 2016-10-28 04:58:09 EDT
New Gerrit change created: https://git.eclipse.org/r/84081
Comment 11 Gabor Bergmann CLA 2016-12-01 03:03:22 EST
The first two tasks have been addressed and they have been measured to increase performance.

Future optimization possibility: 

"Query planning: in case of negative calls, apply constant filter to the negatively called pattern before anti-joining it, if the constant variable is not shared with other other constraints (besides the NAC and the constant constraint)."