There are two methods.
One option is to use the standard Express.js logging mechanism:
DEBUG='sequelize:sql:*' npm run dev
npm run devs
These logs also include some kind of timing information. However, we are not entirely sure that the timings mean, as they show for both Executing (query is about to start) and Executed (query finished) lines with possibly different values e.g.:
sequelize:sql:pg Executing (default): SELECT 1+1 AS result +0ms
sequelize:sql:pg Executed (default): SELECT 1+1 AS result +1ms
The meaning of +0ms and +1ms appears to be the timing since last the last message with the same ID, i.e. sequelize:sql:pg in this case. Therefore, so long as there wasn't any sequelize:sql:pg between and the corresponding Executing, the Executing timing should give us the query time.
This is a bit messy however, as we often want to find the largest numbers for profiling, and there could be a large time delta during inactivity.
A better method for benchmarking is to use intead:
OURBIGBOOK_LOG_DB=1 npm run dev
which produces output of type:
Executed (default): SELECT 1+1 AS result Elapsed time: 0ms
without the corresponding Executing marker. This methos uses Sequelize's benchamrk: true option as per: stackoverflow.com/questions/52260934/how-to-measure-query-execution-time-in-seqilize.