ALAppExtensions icon indicating copy to clipboard operation
ALAppExtensions copied to clipboard

Query Object is not using SIFT (Index View) when records are Summed and Grouped

Open Rama-M opened this issue 6 years ago • 1 comments

Can you please amend the behaviour of Query object so that when records are Summed and Grouped, it needs to use SIFT for better performance.

To demonstrate it, please see example below. The following example from C/AL is not using the SIFT (Index View). Can you please change the system behaviour to use SIFT (Index view) for better performance.

Query Object

OBJECT Query 11006105 PFDeliveries by Collection { OBJECT-PROPERTIES { Date=05/12/19; Time=15:09:47; Modified=Yes; Version List=PF12.00; } PROPERTIES { CaptionML=ENU=Deliveries by Collection; } ELEMENTS { { 1210090000;;DataItem; ; DataItemTable=Table11006112 }

{ 1210090009;1;Filter;CodeFilter         ;
           DataSource=Code }

{ 1210090008;1;Column;                   ;
           DataSource=Code }

{ 1210090001;1;Column;                   ;
           DataSource=Description }

{ 1210090002;1;DataItem;                 ;
           DataItemTable=Table37;
           DataItemTableFilter=Document Type=CONST(Order);
           DataItemLink=PFCollection=PFCollection.Code;
           DataItemLinkType=Use Default Values if No Match }

{ 1210090010;2;Filter;ShipmentDateFilter ;
           DataSource=Shipment Date }

{ 1210090003;2;Column;                   ;
           DataSource=Outstanding Qty. (Base);
           MethodType=Totals;
           Method=Sum }

{ 1210090004;2;Column;                   ;
           DataSource=Qty. to Ship (Base);
           MethodType=Totals;
           Method=Sum }

{ 1210090007;2;Column;                   ;
           DataSource=Qty. Shipped (Base);
           MethodType=Totals;
           Method=Sum }

} CODE {

BEGIN
{
  PF12.00
}
END.

} }

SQL Issued

SELECT TOP (1000) ISNULL("PFCollection"."Code", @0) AS "Code", ISNULL("PFCollection"."Description", @1) AS "Description", ISNULL(SUM("Sales_Line"."Outstanding Qty_ (Base)"), @3) AS "Sum_Outstanding_Qty_Base", ISNULL(SUM("Sales_Line"."Qty_ to Ship (Base)"), @3) AS "Sum_Qty_to_Ship_Base", ISNULL(SUM("Sales_Line"."Qty_ Shipped (Base)"), @3) AS "Sum_Qty_Shipped_Base" FROM "Moto Direct".dbo."MotoDirect Ltd$PFCollection" AS "PFCollection" WITH(READUNCOMMITTED) LEFT OUTER JOIN "Moto Direct".dbo."MotoDirect Ltd$Sales Line" AS "Sales_Line" WITH(READUNCOMMITTED) ON("Sales_Line"."PFCollection" = "PFCollection"."Code") WHERE("Sales_Line"."Document Type" = @2) GROUP BY ISNULL("PFCollection"."Code", @0), ISNULL("PFCollection"."Description", @1) ORDER BY "Code" ASC, "Description" ASC OPTION(OPTIMIZE FOR UNKNOWN, FAST 50, FORCE ORDER, LOOP JOIN);

SIFT Structure Created

Table :- Sales Line Key :- Document Type,PFCollection Sum Index Field :- Outstanding Qty. (Base),Qty. to Ship (Base),Qty. Shipped (Base)

Rama-M avatar Dec 05 '19 15:12 Rama-M

We cannot process this kind of requests here, please go to Ideas site and make your suggestion or escalate via support channels (if you think this is a bug).

AlexanderYakunin avatar Dec 06 '19 11:12 AlexanderYakunin