Skip to content

[BUG] JOIN between different orgs has poor performance #748

Description

@edgeerrol87

Describe the bug
When performing INNER JOIN between two different Dataverse data sources (e.g., [UAT].dbo.contact and [PROD].dbo.contact), SQL4CDS takes 28+ minutes to process what should be a simple join.

To Reproduce
Query to reproduce the behavior:

UPDATE s  
SET parentcustomeridtype = t.parentcustomeridtype,  
parentcustomerid = t.parentcustomerid  
FROM [UAT].dbo.contact AS s  
INNER JOIN [PROD].dbo.contact AS t ON s.contactid = t.contactid  
WHERE t.parentcustomerid IS NOT NULL

Table [UAT].dbo.contact has 22,087 records
Table [PROD].dbo.contact has 22,087 records
Records matching parentcustomerid IS NOT NULL: 3,123
Query takes 28 minutes 30 seconds to execute

Expected behavior

  • Cross-instance joins should be optimized to minimize data transfer
  • Ideally, only matching records should be fetched from each source

Screenshots

Image

Environment (please complete the following information):

  • SQL 4 CDS edition: XrmToolBox
  • Results of SELECT @@VERSION: Microsoft Dataverse - 9.2.26024.163
    SQL 4 CDS - 10.3.0.0
    Feb 04 2026 11:35:51
    Copyright © 2020 - 2025 Mark Carrington

Additional context
The UPDATE operation itself is fast (48s) once the matching records are identified, confirming that the bottleneck is purely in the cross-instance JOIN data retrieval phase.

Sponsorship
If you find this tool useful, please consider sponsoring its development.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions