Гость
Целевая тема:
Создать новую тему:
Автор:
Форумы / Oracle [игнор отключен] [закрыт для гостей] / Не используется индекс по dblink / 3 сообщений из 3, страница 1 из 1
31.03.2017, 16:49
    #39431060
Петров Андрей
Участник
Скрыть профиль Поместить в игнор-лист Сообщения автора в теме
Не используется индекс по dblink
Имеется запрос

Код: plsql
1.
2.
3.
4.
5.
select t.field1
from table1 t
left outer join table2@dblink1 d on d.field3 = t.field4
where t.field2 = '1234'
and d.feild5 is null



Т.е. выбираем данные из table1 и пытаемся найти те, которых нет в table2 по индексу на поле field3
Но по факту table2 фуллсканится, почему?
...
Рейтинг: 0 / 0
31.03.2017, 17:07
    #39431070
Не используется индекс по dblink
Петров Андрей, CARDINALITY + USE_NL (или event 10053 - там всё будет)
...
Рейтинг: 0 / 0
01.04.2017, 01:50
    #39431223
SQL*Plus
Участник
Скрыть профиль Поместить в игнор-лист Сообщения автора в теме
Не используется индекс по dblink
Петров Андрей,

Используйте хинт DRIVING_SITE

Oracle® Database
SQL Language Reference
12c Release 2 (12.2)
E49448-12The DRIVING_SITE hint instructs the optimizer to execute the query at a different site
than that selected by the database. This hint is useful if you are using distributed
query optimization.

For example:
Код: plsql
1.
2.
3.
4.
SELECT /*+ DRIVING_SITE(departments) */ *
FROM employees, departments@rsite
WHERE employees.department_id = departments.department_id;


If this query is executed without the hint, then rows from departments are sent to
the local site, and the join is executed there. With the hint, the rows from employees
are sent to the remote site, and the query is executed there and the result set is
returned to the local site.
...
Рейтинг: 0 / 0
Форумы / Oracle [игнор отключен] [закрыт для гостей] / Не используется индекс по dblink / 3 сообщений из 3, страница 1 из 1
Найденые пользователи ...
Разблокировать пользователей ...
Читали форум (0):
Пользователи онлайн (0):
x
x
Закрыть


Просмотр
0 / 0
Close
Debug Console [Select Text]