diff options
author | Vladislav Vaintroub <wlad@montyprogram.com> | 2012-06-08 19:15:01 +0200 |
---|---|---|
committer | Vladislav Vaintroub <wlad@montyprogram.com> | 2012-06-08 19:15:01 +0200 |
commit | afe1ef5e3a1824ebbfd31fa95b6a198045a0ed34 (patch) | |
tree | b19230ae13ba02808b619513a00333a8c67903c3 /strings/strtoul.c | |
parent | e326a3893f1386875e82b0233b30434a4d296af5 (diff) | |
download | mariadb-git-afe1ef5e3a1824ebbfd31fa95b6a198045a0ed34.tar.gz |
LP1008334 : Speedup specific datetime queries that got slower with introduction of microseconds in 5.3
- Item::get_seconds() now skips decimal arithmetic, if decimals is 0. This significantly speeds up from_unixtime() if no fractional part is passed.
- replace sprintfs used to format temporal values by hand-coded formatting
Query1 (original query in the bug report)
BENCHMARK(10000000,DATE_SUB(FROM_UNIXTIME(RAND() * 2147483648), INTERVAL (FLOOR(1 + RAND() * 365)) DAY))
Query2 (Variation of query1 that does not use fractional part in FROM_UNIXTIME parameter)
BENCHMARK(10000000,DATE_SUB(FROM_UNIXTIME(FLOOR(RAND() * 2147483648)), INTERVAL (FLOOR(1 + RAND() * 365)) DAY))
Prior to the patch, the runtimes were (32 bit compilation/AMD machine)
Query1: 41.53 sec
Query2: 23.90 sec
With the patch, the runtimes are
Query1: 32.32 sec (speed up due to removing sprintf)
Query2: 12.06 sec (speed up due to skipping decimal arithmetic)
Diffstat (limited to 'strings/strtoul.c')
0 files changed, 0 insertions, 0 deletions