Empresas
Empregos
  • Sobre nós
  • Soluções
    • Publicação de vagas
      Publique sua vaga e receba candidatos qualificados em 48h.
    • Avaliações de candidatos
      Mais de 500 testes técnicos e psicológicos, mais anti-fraude.
    • Headhunting
      Busca executiva personalizada do início ao fim.
    • Folha de Pagamento + EOR
      Dispersão de folha e EOR em mais de 15 países da LATAM.
  • Preços
  • Empregos

0

89
Visualizações
nodejs oracledb performance diff by the way of binding params

I wonder if there is a performance difference between below cases.

  • nodejs oracledb lib - express server

  • connection code - 1 query, 1 connection whenever I send a query, I always make a new connection. when data returned, I cut the connection.

return new Promise( async function ( resolve, reject ) {

            let result = [], conn = null

            try {

                conn = await oracledb.getConnection( {
                } )

                console.log( 'DB OPENED' )

                result = await conn.execute( query, bindParams, options )
                resolve( result )

            } catch ( e ) {

                console.log( ' ---- E: a_sendQuery ----' )
                console.error( e )
                console.log( ' ---- E: a_sendQuery ----' )

                reject( e )

            } finally {
                if ( conn ) {
                    try {
                        await conn.close()
                        console.log( 'DB CLOSED' )

                    } catch ( e ) {
                        console.log( ' ---- E: a_sendQuery: FINALLY ----' )
                        console.error( e )
                        console.log( ' ---- E: a_sendQuery: FINALLY ----' )
                    }
                }
            }

queries are

  1. bind value with query (select * from table where id = 1)
  2. bind as bindParams (select * from table where id = :id, let bindParams = [1])

as far as my understanding from this doc: https://www.zybuluo.com/WrRan/note/570707 it uses init query statement to boost up the performance. but I couldn't find any info about how to connect db and send query from examples. My senior said I have to fix all my code so that we can get more performance but .. I don't know. I'm not sure... does oracledb remember use init queries even connection is new..?

about 4 years ago · Juan Pablo Isaza
Responde à pergunta
Encontrar trabalhos remotos

Descubra a nova forma de encontrar um emprego!

melhores empregos
Principais categorias de trabalho
Empresas
Postar vaga Preços Comercial
Jurídico
Termos e Condições Política de privacidade
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomende algumas ofertas para mim
Preciso de ajuda