|
|
|
Замещающий (INSTEAD) триггер тормозит на внутреннем системном запросе Oracle
|
|||
|---|---|---|---|
|
#18+
Здравствуйте, разумные. Передали на сопровождение чужой подтормаживающий код. Вставка записей идет во вьюху, на которую повешен замещающий (INSTEAD) триггер, который и делает нужные INSERT/UPDATE/DELETE в 3 таблицы. Сделал трейс тормозящего куска сессии. При анализе вижу, что 90% времени по сессии теряется на запрос, который вызывается при каждой вставке: Connected to: Oracle Database 10g Enterprise Edition Release 10.2.0.4.0 - 64bit Production With the Partitioning, OLAP, Data Mining and Real Application Testing options Код: plsql 1. 2. 3. 4. 5. 6. 7. 8. 9. 10. 11. 12. 13. 14. 15. 16. 17. 18. 19. 20. 21. 22. Запрос порождает внутренний механизм Oracle. В переданных исходниках ничего подобного нет. Прошу проконсультировать: откуда берется, как избавиться или оптимизировать. ... |
|||
|
:
Нравится:
Не нравится:
|
|||
| 20.03.2018, 13:31 |
|
||
|
Замещающий (INSTEAD) триггер тормозит на внутреннем системном запросе Oracle
|
|||
|---|---|---|---|
|
#18+
azavЗапрос порождает внутренний механизм Oracle."внутренний механизм Oracle" породил бы запрос к таблицам, а не представлениям. Ищи ещё. ... |
|||
|
:
Нравится:
Не нравится:
|
|||
| 20.03.2018, 14:22 |
|
||
|
Замещающий (INSTEAD) триггер тормозит на внутреннем системном запросе Oracle
|
|||
|---|---|---|---|
|
#18+
Да че тут искать -- [практически] любая фраза из запроса в гугл сразу отправляет на https://support.oracle.com/knowledge/Oracle Database Products/1386371_1.html (это еще не закрытая страничка) ... |
|||
|
:
Нравится:
Не нравится:
|
|||
| 20.03.2018, 14:37 |
|
||
|
Замещающий (INSTEAD) триггер тормозит на внутреннем системном запросе Oracle
|
|||
|---|---|---|---|
|
#18+
Спасибо за помощь. Для ищущих сохраню ответ: The query is executed by the Oracle Data Provider for .Net to gather the primary key and unique column information of the columns selected in the sql query. The only way to reduce the number of times this sql query is executed by ODP.NET is by using Statement Caching. When you use statement caching, on the first execution of the sql statement. ODP.NET will issue a query to gather the primary key and unique column information. Once it has been gathered, it will store that information in the statement cache. On the next execution of that sql statement on the same connection, it will use the information from the statement cache to execute the sql. With ODP.NET versions 11.1.0.6.20 or earlier, the statement cache is enabled by default. The Statement Cache Size=10. With ODP.NET versions 11.1.0.7.20 or later, Self Tuning is introduced and enabled by default. This feature provides dynamic tuning of the statement cache for applications to achieve optimal performance. This eliminates the need to manually tune the cache for an application. When using ODP.NET versions 11.1.0.7.20 or later and self tuning is disabled manually, you will need to manually set the Statement Cache Size to enable Statement Caching for your application. This is referred to as "Manually Tuning the Cache". Statement Caching can be turned on in the connection string by using the setting: Statement Cache Size = <Number of sql statements you want cached> ie. Statement Cache Size=200;The query is executed by the Oracle Data Provider for .Net to gather the primary key and unique column information of the columns selected in the sql query. The only way to reduce the number of times this sql query is executed by ODP.NET is by using Statement Caching. When you use statement caching, on the first execution of the sql statement. ODP.NET will issue a query to gather the primary key and unique column information. Once it has been gathered, it will store that information in the statement cache. On the next execution of that sql statement on the same connection, it will use the information from the statement cache to execute the sql. With ODP.NET versions 11.1.0.6.20 or earlier, the statement cache is enabled by default. The Statement Cache Size=10. With ODP.NET versions 11.1.0.7.20 or later, Self Tuning is introduced and enabled by default. This feature provides dynamic tuning of the statement cache for applications to achieve optimal performance. This eliminates the need to manually tune the cache for an application. When using ODP.NET versions 11.1.0.7.20 or later and self tuning is disabled manually, you will need to manually set the Statement Cache Size to enable Statement Caching for your application. This is referred to as "Manually Tuning the Cache". Statement Caching can be turned on in the connection string by using the setting: Statement Cache Size = <Number of sql statements you want cached> ie. Statement Cache Size=200; ... |
|||
|
:
Нравится:
Не нравится:
|
|||
| 20.03.2018, 15:35 |
|
||
|
|

start [/forum/topic.php?fid=52&msg=39617551&tid=1884262]: |
0ms |
get settings: |
9ms |
get forum list: |
14ms |
check forum access: |
4ms |
check topic access: |
4ms |
track hit: |
33ms |
get topic data: |
10ms |
get forum data: |
3ms |
get page messages: |
35ms |
get tp. blocked users: |
1ms |
| others: | 244ms |
| total: | 357ms |

| 0 / 0 |
