Database execution time
Answered
When a query gets executed you get some metrics at the end in the database console pane, for example:
1 row retrieved starting from 1 in 8 s 386 ms (execution: 8 s 374 ms, fetching: 12 ms)
Is the execution the time the database took to execute? What does fetching mean?
Please sign in to leave a comment.
Execution time: yes - it is the time taken to execute the statement by the database. Fetching time - the time which took retrieving the data (result set) from the database.
In one example, I see:
[2024-01-23 16:01:04] 0 rows retrieved in 2 h 2 m 47 s 874 ms (execution: 309 ms, fetching: 2 h 2 m 47 s 565 ms)
How can it take over 2 hours to retreive 0 rows?
I'm quite certain the query is slow because of a missing index. But I would have expected to see a long ‘execution’ time in this case.
My understanding is that the ‘fetch’ time is how long it takes to retrieve the data…which in my case is 0 rows, so I'd expect the fetch time to essentially be 0ms.
So, I'm not really asking for help investigating the performance, but rather a clearer explaination of what ‘execution’ time and ‘fetch’ time actually refer to.
thanks
In your case, if the table didn't have an index, it would actually increase the query execution time as it would force a full table scan or other inefficient plans. Therefore, it shouldn't impact the fetch time, especially if there are no records in the table.
That said, I'd suggest specifying your database and table definition (we're particularly interested if columns are of CLOB or BLOB types). As a workaround, you could try to uncheck "Limit page size to" option in File | Settings | Database | Data Editor and Viewer and see if it improves the situation.