A 64bit counter can overflow within the time of a query
so lets take it that the measurement is the small value
rather than an order 1e12 millisecond query.
tested with:
int main()
{
ulonglong start = ULONGLONG_MAX - 30;
ulonglong end = 600;
ulonglong cycles = 10000;
cycles += end - start;
if (unlikely(end < start))
cycles += ULONGLONG_MAX;
printf("cycles %llu\n", cycles);
}
- Remove ANALYZE's timing code off the the execution path of regular
SELECTs.
- Improve the tracker that tracks counts/execution times of SELECTs or
DML statements:
= regular execution just increments counters
= ANALYZE will also collect timings.