Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
Home -> Community -> Usenet -> c.d.o.server -> db_links and optimiser problem?
[posted on behalf of a collegue]
I am having serious response problems when attempting to combine local and remote database tables in one SQL query. Obviously this in itself is not the problem, something else is the cause but what????
SELECT remote.x, remote.y, remote.z
FROM remote_at_db1
WHERE 1 = 1;
Works correctly
SELECT remote.x, remote.y, remote.z, sysdate
FROM remote_at_db1
WHERE 1 = 1;
Works correctly
SELECT remote.x, remote.y, remote.z
FROM remote_at_db1, dual
WHERE 1 = 1;
Dies a horrible death
SELECT remote.x, remote.y, remote.z, sysdate
FROM remote_at_db1, dual
WHERE 1 = 1;
Also dead
I've used dual as an example but really I can use any local database, also the sql is pretty basic, the problem really came about when using in-line views, I've just stripped away the code that is not causing any problem.
The remote db table has an index that gets used correctly when dual is not included however it appears not to be used when dual is included, even after adding in hints.
The remote db table is quite large (2GB). The sql, when it runs!! only returns 70 rows and takes about 1 sec cpu which is why I want to use it in a in-line view rather than joining on the whole table.
The other point to note is that the local db is 8.0.3, the remote is 7.3.3.
This is the explain of the query without a local db in the from clause:
Execution Plan
0
SELECT STATEMENT (REMOTE) Optimizer=CHOOSE (Cost=141 Card=4543
Bytes=236236)
1 0
2 1
Execution Plan
0
SELECT STATEMENT Optimizer=RULE
1 0
2 1
3 1
4 3 REMOTE*
Can any help?
Thanks.
rgds,
Jon Waland
Vodafone Ltd.
Received on Thu Oct 08 1998 - 02:54:18 CDT