Oi pessoal, é assim aqui no ambiente onde trabalho temos alguns select que o mesmo select resulta em varios hash plan, sabe -se que isso é problema da aplicação que foi desenvolvida sem ter em conta este aspecto, alguem sabe um documento oficial da Oracle ou um documento explicativo que eu possa usar para enviar ao fornecedor da aplicação para comprovar o facto, eles só aceitam e acreditam naquilo que vem com varias provas.
Eles não fizeram o bind das variaveis do SQL.
Qualquer ajuda é bem vinda, eu não sei como explicar isso de maneira clara para eles com um documento oficial.
Varios sql hash plan para o mesmo select
Re: Varios sql hash plan para o mesmo select
Opa, para começar, o Performance Tuning Guide cita este como um dos 10 erros mais comuns de desempenho em Oracle.
Aliás, é a causa numero 2 da lista.
http://docs.oracle.com/cd/E11882_01/ser ... PFGRF94138
Bad use of cursors and the shared pool
Not using cursors results in repeated parses. If bind variables are not used, then there is hard parsing of all SQL statements. This has an order of magnitude impact in performance, and it is totally unscalable. Use cursors with bind variables that open the cursor and execute it many times. Be suspicious of applications generating dynamic SQL.
Aliás, é a causa numero 2 da lista.
http://docs.oracle.com/cd/E11882_01/ser ... PFGRF94138
Bad use of cursors and the shared pool
Not using cursors results in repeated parses. If bind variables are not used, then there is hard parsing of all SQL statements. This has an order of magnitude impact in performance, and it is totally unscalable. Use cursors with bind variables that open the cursor and execute it many times. Be suspicious of applications generating dynamic SQL.
Re: Varios sql hash plan para o mesmo select
Achei outra parte da documentação que também te ajuda.
http://docs.oracle.com/cd/E11882_01/ser ... #CNCPT7659
Use bind variables
When a query uses bind variables, the database can compile it once and store the query plan in the shared pool. If the same statement is executed again, then the database can perform a soft parse and reuse the plan. In contrast, a hard parse takes longer and uses more resources (see "SQL Parsing"). Using bind variables to allow soft parsing is very efficient and is the way the database intends developers to work.
http://docs.oracle.com/cd/E11882_01/ser ... #CNCPT7659
Use bind variables
When a query uses bind variables, the database can compile it once and store the query plan in the shared pool. If the same statement is executed again, then the database can perform a soft parse and reuse the plan. In contrast, a hard parse takes longer and uses more resources (see "SQL Parsing"). Using bind variables to allow soft parsing is very efficient and is the way the database intends developers to work.
Re: Varios sql hash plan para o mesmo select
Mais uma fonte para você.
Isto está até no manual da 7.3.
http://profissionaloracle.com.br/blogs/ ... te-quando/
Isto está até no manual da 7.3.
http://profissionaloracle.com.br/blogs/ ... te-quando/
Re: Varios sql hash plan para o mesmo select
E para encontrar os SQLs agressores, utilizo este SELECT.
http://nervinformatica.com.br/blog/2012 ... sem-binds/
http://nervinformatica.com.br/blog/2012 ... sem-binds/