I am having some issues with the transfer step when loading incremental using direct read. The problem seems to be that the generated procedures do not utilize indices on the underlying tables, resulting in full PK scans for every run.
I was especially having problems when running on azure general compute. Switching to hyperscale helped some, but the transfer step still uses approx 40sec scanning ~90m rows causing bottlenecks.
When using ADO.NET I could set an index on the incremental rule-field speeding up the search to <1sec.
![](https://uploads-eu-west-1.insided.com/timextender-en/attachment/c50f0d65-bb3b-4477-b8f3-18984f985408.png)
![](https://uploads-eu-west-1.insided.com/timextender-en/attachment/fa0e17ed-d953-4849-96f2-971fbffc570f.png)
The execution-plan generated by TX looks like this:
![](https://uploads-eu-west-1.insided.com/timextender-en/attachment/1b83fca0-1ea9-4440-b098-0465fa4a0b6b.png)
Here we get a PK index-scan even when there is an index on dw-timestamp.
Testing on a subset of the data (~10mill rows):
![](https://uploads-eu-west-1.insided.com/timextender-en/attachment/3707d557-2222-4d13-a0ac-07eeba841350.png)
![](https://uploads-eu-west-1.insided.com/timextender-en/attachment/076e4cb3-4ccf-48fd-ae67-16fbc9744637.png)
Adding the option(recompile) to the procedure results in the procedure using the dw-timestamp index:
![](https://uploads-eu-west-1.insided.com/timextender-en/attachment/c8631251-78c7-4352-b014-a1b7323133d0.png)
![](https://uploads-eu-west-1.insided.com/timextender-en/attachment/f69ec705-da82-4344-829b-516487368ec8.png)
![](https://uploads-eu-west-1.insided.com/timextender-en/attachment/40dc9530-d537-4eda-be4c-f303658d3e56.png)
Is there a good reason for why these procedures are generated without the recompile flag?
Is it something that could be added in a later release?
And is there a way to work around this other than reverting to ADO-net transfers or SSIS? Scaling the DB/service tiers to compensate for something using a simple index could do better seems like a poor solution.
Might be semi-related to this post:ADO.NET Transfer consistently slow on incremental table with no new rows | Community (timextender.com)