Skip to content

[releases/29.x] [Shopify] Role Center slow: "Unmapped Customers/Products/Companies" cues count over a lookup FlowField, degrading COUNT(*) into a full-table row-by-row scan - #11000

Open
Onat Buyukakkus (onbuyuka) wants to merge 1 commit into
releases/29.xfrom
bugs/648900-backport

Conversation

@onbuyuka

@onbuyuka Onat Buyukakkus (onbuyuka) commented Sep 3, 2026

Copy link
Copy Markdown
Contributor

Summary

Backport of bug #648153 to releases/29.x.

Fixes AB#648900

Original PR: #10775

## Summary

The Shopify Activities cues for unmapped customers, products, and
companies currently count records through lookup FlowFields. Business
Central cannot push those predicates into a SQL aggregate, so it
materializes the source tables and evaluates the lookup row by row on
every Role Center refresh.

## Change

- Count empty stored Customer/Item SystemId fields so SQL can execute a
direct `COUNT(*)`.
- Add a key led by `Item SystemId` so the global unmapped-product count
can seek without an unconstrained `Shop Code` prefix.

## Behavioral note

A record with a nonempty SystemId that points to a deleted Customer or
Item is no longer included in the cue. Such dangling mappings are a
separate data-integrity concern.

Fixes
[AB#648153](https://dynamicssmb2.visualstudio.com/1fcb79e7-ab07-432a-a3c6-6cf5a88ba4a5/_workitems/edit/648153)

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Copilot-Session: 7eddc4b9-3e13-4d0a-8700-079111aff9ad
@onbuyuka
Onat Buyukakkus (onbuyuka) requested a review from a team September 3, 2026 10:23
@onbuyuka
Onat Buyukakkus (onbuyuka) requested a review from a team as a code owner September 3, 2026 10:23
@github-actions github-actions Bot added AL: Apps (W1) Add-on apps for W1 Team: Integrations GitHub request for Integrations area labels Sep 3, 2026
@github-actions github-actions Bot added this to the Version 29.1 milestone Sep 3, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

AL: Apps (W1) Add-on apps for W1 Team: Integrations GitHub request for Integrations area

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants