Why is selecting across a link faster than selecting within the database?
We have a massive query that accesses multiple views and does a nasty union as well. One of the views we pull from is on our database server in the cloud, across a database link. Using the "cloud" view we get a nice run of about 3 minutes on the select. When we try to duplicate that view on the database here on the ground where we are running so as to not have to pull across the link - it takes OVER an hour.
We are really scratching our heads on this one. Any suggestions?
We are 12.2 on the database servers here on the ground, 19.17 up in the cloud.