Grouping Semantic

Report 2 Downloads 256 Views
Grouping Semantic

SoCIM, 10th of May 2017, London Paweł Susicki, Jan Posiadała {trzeci,janek}@tiger.com.pl

Implied group by Implied group by is neat but, two following queries give (in neo4j) two diffrent results: create (:L {a:1,b:2,c:3}) create (:L {a:2,b:3,c:1}) create (:L {a:3,b:1,c:2})

match (x:L) return x.a + count(*) + x.b + count(*) + x.c;

match (x:L) return x.a + x.b + x.c + count(*) + count(*);

Query Results

Query Results

+----------------------------------------+ | x.a + count(*) + x.b + count(*) + x.c | +----------------------------------------+ | 8 | | 8 | | 8 | +----------------------------------------+ 3 rows 96 ms

+----------------------------------------+ | x.a + x.b + x.c + count(*) + count(*) | +----------------------------------------+ | 12 | +----------------------------------------+ 1 row 77 ms

No adjustment in TCK Grouping Semantic SoCIM, 10th of May 2017, London

Aggregation key Problem: to designate aggregation key (and aggregated expressions).

match (x:L) return x.a + count(*) + x.b + count(*) + x.c;

match (x:L) return x.a + x.b + x.c + count(*) + count(*);

Query Results

Query Results

+----------------------------------------+ | x.a + count(*) + x.b + count(*) + x.c | +----------------------------------------+ | 8 | | 8 | | 8 | +----------------------------------------+

+----------------------------------------+ | x.a + x.b + x.c + count(*) + count(*) | +----------------------------------------+ | 12 | +----------------------------------------+ 1 row 77 ms

Aggregation key: (x.a, x.b, x.c) gives result of size 3

Aggregation key: (x.a + x.b + x.c) gives result of size 1

Grouping Semantic SoCIM, 10th of May 2017, London

Current neo4j approach A heuristic algorithm of extraction component expression of grouping key, which fails in the given example due to some optimization >>rewritings