node-sqlserver-v8 icon indicating copy to clipboard operation
node-sqlserver-v8 copied to clipboard

How to debug preparation statements timings?

Open Doc999tor opened this issue 5 years ago • 1 comments

Some times I have enormous response times from the DB I broke the timings into small parts and got the biggest piece ate by preparing statements How can I debug the preparation?

getEventsByWorker 564 new PreparedStatement: 0.194ms
getEventsByWorker 564 prepare: 1.248s -- enormous
getEventsByWorker 564 execute: 50.557ms
getEventsByWorker 564 total: 1.303s 

My query is not too small: 2k of sql code (simple select with a lot of fields) with simple where clause. 3 input varchar fields

stmt.input('worker_id', Int)
stmt.input('start', VarChar(50))
stmt.input('end', VarChar(50))

Nodejs: 13.8.0 Node library: mssql 6.0.1 Driver: msnodesqlv8 0.8.7 SQL Server: 2017

Doc999tor avatar Mar 10 '20 15:03 Doc999tor

Hey, any thoughts about it? I want to separate the timings between the db itself and the driver - for better locating the problem

Doc999tor avatar Jun 09 '20 22:06 Doc999tor