MikeGo
Valued Contributor

Appreciate for the input. Thanks.

We try to use delta table as a streaming sink, so we don't want to control the update frequency for the raw table and target to load it asap. The default checkpointinterval is actually 10. I tried to change it to bigger values but that didn't impact the perf too much. 

I also tried many other configs, but nothing can impact the perf significantly. The duration is sort of linear to version num. The fact is even if I made it down to 40K files under _delta_log, it is still slow, and even if the readStream has a filter like where 1==2, viz. read nothing it is still slow. 

From reading the log I can also see it tries to load version files from last trigger for schema incompatible check, which makes it worse.

I'm guessing this. v0, v1, ... v10, cp1, v11..., cp2, .... every 10 transactions with a checkpoint file can make it restore to any point easily, but if it needs to get changes between 2 versions, there is no compact files it can use. Is the delta table supposed to design something to compact incremental changes too instead of only creating a full snapshot in checkpoint?
Also I'm not sure whether there is file listing. From log I can only see `AWSCredentialProviderList:V3: Using credentials for bucket xxx

from com.databricks.backend.daemon.driver.credentials.CredentialScopeS3TokenProvider`. I understand the steps to find closest checkpoint, apply changes, schema check etc., but can you please share how the 18000 version files are processed to apply the changes? Does it really need file listing? E.g. from https://github.com/delta-io/delta/blob/master/spark/src/main/scala/org/apache/spark/sql/delta/source... 
```
val DELTA_HISTORY_PAR_SEARCH_THRESHOLD =
buildConf("history.maxKeysPerList")
.internal()
.doc("How many commits to list when performing a parallel search. Currently set to 1000, " +
"which is the maximum keys returned by S3 per list call. Azure can return 5000, " +
"therefore we choose 1000.")
.intConf
.createWithDefault(1000)
```
Is there any bottleneck in this process? (as mentioned, I tried to make _delta_log has around 40K files, but still slow).
 
Thanks.