Hello,
i turned aggregates ON and it looks like Mondiran 4.X uses aggregates only for Segment loading, not for tuples
As example, here is a part of log of the same request:
22254 [mondrian.rolap.RolapResultShepherd$executor_1] DEBUG mondrian.sql - 22: SqlTupleReader.readTuples [[Publisher Ad Block].[internal_slot_id].[internal_slot_id], [Placement].[Placement Site].[Placement Site]]: executing sql [select "dim_slot"."slot_id" as "c0", "dim_placement"."placement_site" as "c1" from "fact_impress" as "fact_impress", "dim_slot" as "dim_slot", "dim_placement" as "dim_placement" where "dim_slot"."publisher_id" = 600 and "fact_impress"."dim_slot_fk" = "dim_slot"."dim_slot_id" and "fact_impress"."dim_placement_fk" = "dim_placement"."dim_placement_id" group by "dim_slot"."slot_id", "dim_placement"."placement_site" order by CASE WHEN "dim_slot"."slot_id" IS NULL THEN 1 ELSE 0 END, "dim_slot"."slot_id" ASC, CASE WHEN "dim_placement"."placement_site" IS NULL THEN 1 ELSE 0 END, "dim_placement"."placement_site" ASC]
23000 [mondrian.rolap.RolapResultShepherd$executor_1] DEBUG mondrian.sql - 22: , exec 745 ms
and after that:
25071 [mondrian.rolap.agg.SegmentCacheManager$sqlExecutor_1] DEBUG mondrian.sql - 28: Segment.load: executing sql [select "dim_datetime"."yyyymmdd" as "c0", "dim_slot"."slot_id" as "c1", "dim_slot"."publisher_id" as "c2", "dim_placement"."placement_site" as "c3", sum("slot_placement_aggr_view"."auction_count") as "m0", sum("slot_placement_aggr_view"."conversion_count") as "m1", sum("slot_placement_aggr_view"."estimated_amount") as "m2" from "slot_placement_aggr_view" as "slot_placement_aggr_view", "dim_datetime" as "dim_datetime", "dim_slot" as "dim_slot", "dim_placement" as "dim_placement" where "dim_datetime"."yyyymmdd" in (20150716, 20150717, 20150718, 20150719, 20150720, 20150721, 20150722, 20150723, 20150724, 20150725, 20150726, 20150727, 20150728, 20150729, 20150730, 20150731, 20150801, 20150802, 20150803, 20150804, 20150805, 20150806, 20150807, 20150808, 20150809, 20150810, 20150811, 20150812, 20150813, 20150814) and "dim_slot"."slot_id" = 59 and "dim_slot"."publisher_id" = 600 and ("dim_placement"."placement_site" in ('111.221.29.49', '131.253.14.125', '212.82.99.181', '65.55.108.4', 'fanyi.ydstatic.com', 'kroika****ie.ru', 'localhost', 'osinka.ru', 'osinka.ru.', 'osinkaru.tcinet.biz', 'partner.googleadservices.com', 'place.leadada.com', 'surf706.appspot.com', 'translate.googleusercontent.com', 'webcache.googleusercontent.com', 'www.osinka.ru') or "dim_placement"."placement_site" is null) and "slot_placement_aggr_view"."dim_datetime_fk" = "dim_datetime"."dim_datetime_id" and "slot_placement_aggr_view"."dim_slot_fk" = "dim_slot"."dim_slot_id" and "slot_placement_aggr_view"."dim_placement_fk" = "dim_placement"."dim_placement_id" group by "dim_datetime"."yyyymmdd", "dim_slot"."slot_id", "dim_slot"."publisher_id", "dim_placement"."placement_site"]
From this i see that readTuples uses fact table fact_impress, while Segment.load uses aggregate.
I found a discussion around that and an issue: http://forums.pentaho.com/showthread...gregratetables
http://jira.pentaho.com/browse/MONDRIAN-650
Looking at SqlTupleReader.java i found the commented lines, related to this issue:
// = chooseAggStar(constraint, measureGroup, evaluator);
final RolapMeasureGroup aggMeasureGroup = null; // TODO:
My question is:
does Tuple read from aggregates is working in 4.X Mondrian ?
If not - how to fix that ( probably by schema ? or config ? )
Regards,
Aleksey
i turned aggregates ON and it looks like Mondiran 4.X uses aggregates only for Segment loading, not for tuples
As example, here is a part of log of the same request:
22254 [mondrian.rolap.RolapResultShepherd$executor_1] DEBUG mondrian.sql - 22: SqlTupleReader.readTuples [[Publisher Ad Block].[internal_slot_id].[internal_slot_id], [Placement].[Placement Site].[Placement Site]]: executing sql [select "dim_slot"."slot_id" as "c0", "dim_placement"."placement_site" as "c1" from "fact_impress" as "fact_impress", "dim_slot" as "dim_slot", "dim_placement" as "dim_placement" where "dim_slot"."publisher_id" = 600 and "fact_impress"."dim_slot_fk" = "dim_slot"."dim_slot_id" and "fact_impress"."dim_placement_fk" = "dim_placement"."dim_placement_id" group by "dim_slot"."slot_id", "dim_placement"."placement_site" order by CASE WHEN "dim_slot"."slot_id" IS NULL THEN 1 ELSE 0 END, "dim_slot"."slot_id" ASC, CASE WHEN "dim_placement"."placement_site" IS NULL THEN 1 ELSE 0 END, "dim_placement"."placement_site" ASC]
23000 [mondrian.rolap.RolapResultShepherd$executor_1] DEBUG mondrian.sql - 22: , exec 745 ms
and after that:
25071 [mondrian.rolap.agg.SegmentCacheManager$sqlExecutor_1] DEBUG mondrian.sql - 28: Segment.load: executing sql [select "dim_datetime"."yyyymmdd" as "c0", "dim_slot"."slot_id" as "c1", "dim_slot"."publisher_id" as "c2", "dim_placement"."placement_site" as "c3", sum("slot_placement_aggr_view"."auction_count") as "m0", sum("slot_placement_aggr_view"."conversion_count") as "m1", sum("slot_placement_aggr_view"."estimated_amount") as "m2" from "slot_placement_aggr_view" as "slot_placement_aggr_view", "dim_datetime" as "dim_datetime", "dim_slot" as "dim_slot", "dim_placement" as "dim_placement" where "dim_datetime"."yyyymmdd" in (20150716, 20150717, 20150718, 20150719, 20150720, 20150721, 20150722, 20150723, 20150724, 20150725, 20150726, 20150727, 20150728, 20150729, 20150730, 20150731, 20150801, 20150802, 20150803, 20150804, 20150805, 20150806, 20150807, 20150808, 20150809, 20150810, 20150811, 20150812, 20150813, 20150814) and "dim_slot"."slot_id" = 59 and "dim_slot"."publisher_id" = 600 and ("dim_placement"."placement_site" in ('111.221.29.49', '131.253.14.125', '212.82.99.181', '65.55.108.4', 'fanyi.ydstatic.com', 'kroika****ie.ru', 'localhost', 'osinka.ru', 'osinka.ru.', 'osinkaru.tcinet.biz', 'partner.googleadservices.com', 'place.leadada.com', 'surf706.appspot.com', 'translate.googleusercontent.com', 'webcache.googleusercontent.com', 'www.osinka.ru') or "dim_placement"."placement_site" is null) and "slot_placement_aggr_view"."dim_datetime_fk" = "dim_datetime"."dim_datetime_id" and "slot_placement_aggr_view"."dim_slot_fk" = "dim_slot"."dim_slot_id" and "slot_placement_aggr_view"."dim_placement_fk" = "dim_placement"."dim_placement_id" group by "dim_datetime"."yyyymmdd", "dim_slot"."slot_id", "dim_slot"."publisher_id", "dim_placement"."placement_site"]
From this i see that readTuples uses fact table fact_impress, while Segment.load uses aggregate.
I found a discussion around that and an issue: http://forums.pentaho.com/showthread...gregratetables
http://jira.pentaho.com/browse/MONDRIAN-650
Looking at SqlTupleReader.java i found the commented lines, related to this issue:
// = chooseAggStar(constraint, measureGroup, evaluator);
final RolapMeasureGroup aggMeasureGroup = null; // TODO:
My question is:
does Tuple read from aggregates is working in 4.X Mondrian ?
If not - how to fix that ( probably by schema ? or config ? )
Regards,
Aleksey