https://slingdata.io logo
Common performance tweaks for Oracle->
# sling-help
d
Common performance tweaks for Oracle->Oracle? Morning all, Do let me know if this isn't the right forum but I'm running into some performance concerns. We currently use Oracle DB_Links to move stuff between our on-prem boxes - this is obviously lightning quick and I wouldn't expect the same performance from any none native tool but It's messy and further entrenches our Oracle lock-in. Last year I started experimenting with sling as a database agnostic replacement for this setup (and to get rid of a bunch of bespoke python "put this stuff over there" scripts) but I'm struggling to achieve an acceptable execution time with it. My dev platform is currently based on Dagster with their new Components for dbt and sling - I'm loving both at the moment, trying to keep as much as possible in yaml. The pure oracle db_link approach completes a 4 column 4mil row table of mostly friendly datatypes in ~20 seconds - it's primarily INT and datetime data there. The same table in my current sling setup executes in ~250 seconds. That's a significant increase (~x10) but, again, I am benchmarking against likely one of the most performant ways possible to do this. When I complete a similar benchmark against much less friendly tables, like an address one with data that's all over the place, the db_link takes about a minute and my current sling setup takes... an unknowable amount of time, I've never let it run for more than an hour. This isn't a perfect comparison as there are hardware differences between both the executing and source machines but I don't know enough about the sling internals to really comment on impact there. Any insider information here on what I might try to close that gap? I've attempted some common sense changes already but nothing that really moved the needle. For info: This is all windows on-prem with no immediate view to move to cloud, hopefully be able to move to an incremental load this year but currently running a full drop/reload.
f
hey @Daniel , thanks for the details. Can you confirm that you're using
sqlldr
to bulk load into oracle? this should show in the debug logs. sling uses that if it is installed on the machine (available in PATH). If not, it uses the
INSERT ALL
statement, which would be much slower than
sqlldr
. So give that a try if not currently doing and let me know how it goes.
d
I'll have a look at that, my SQL log is showing INSERT ALL so I suspect not. I've got the sqlldr notes here from the [docs](https://docs.slingdata.io/connections/database-connections/oracle?ask=help+me+make+sling+use+sqlldr++with+oracle) so will give it a go and report back
setting things up to work with Oracles SQL*Loader (sqlldr) has now got us to about 4x the native db_link execution time, which is much more inline with what I original expected. Much thanks, and another win for "Go read the documentation"! Am I right in assuming that, using sqlldr, sling will pull down all the source system data to a file then use SQL*Loader to push it in from there?
f
Yes, exactly. Would be even faster on Linux, which writes straight to stdin of sqlldr, no temp file. https://github.com/slingdata-io/sling-cli/blob/main/core/dbio/database/database_oracle.go#L320
3 Views