A co-worker has a very simple Dataflow:
Source Table (SFDC) --> Query --> Target (Oracle)
The source SFDC table has 6 million rows in it. The Query transform has a WHERE clause of “SFDC_Column IS NULL”. That’s it, nothing else in the WHERE clause, no DISTINCT, no ORDER BY.
The Dataflow is reading every row from the Salesforce table and then applying the WHERE clause at the job server and eventually (hours and hours later!) writes 27,000 rows to the target table.
Is there some trick to getting the WHERE clause pushed down to Salesforce so we don’t read 6 million rows just to get 27,000 rows?
what is the SQL that is getting pushed down to the SFDC ? you can check this in the log
I think IS NULL is not getting pushed down, what else is there in the mapping, if you are using some functions etc in mapping that may also prevent the push down, best is to do all the mappings etc in another Query transform, keep the first query transform for selecting the row and where clause
I haven’t pulled the syntax that is being sent to SFDC. I’m not sure where to find this or if it is already being generated. Do I need to turn on tracing to see it?
There is nothing special in this Dataflow. The mappings are all straight column to column mappings. The only thing “custom” about the Dataflow is the WHERE clause.
Pulling the data down takes 14 hours. It takes only a few minutes to push the 27,000 rows back up to SFDC as updates.
This is happening on version 12.1 of Data Services.
yes, you will have to enable trace for the adapter instance (you can do this from Management console, from Adapter configuration page), restart the instance
before running the job move or delete the %LINK_DIR%\adapters\log<sfdc_adapter_instance_name>_trace.txt and <sfdc_adapter_instance_name>_error.txt files, this to get the latest trace and avoid opening a very big file
Performing a trace is going to take a while to coordinate.
In the mean time we modified the Dataflow that had the problem and changed the IS NULL expression to = ‘5688958’. The Dataflow completed in less than 2 seconds. Based on the results, I have to conclude that the IS NULL expression is not getting pushed down but an equals expression does get pushed down.