[MDEV-4265] 5.5 is slower than 5.3 because of many str_to_datetime calls Created: 2013-03-11  Updated: 2016-04-16  Resolved: 2013-03-14

Status: Closed
Project: MariaDB Server
Component/s: None
Affects Version/s: 5.5.30
Fix Version/s: 5.5.31

Type: Bug Priority: Critical
Reporter: Sergei Petrunia Assignee: Sergei Golubchik
Resolution: Fixed Votes: 0
Labels: None

Attachments: File lineitem_small.sql.gz    
Issue Links:
Problem/Incident
causes MDEV-4284 Assertion `cmp_items[(uint)cmp_type]'... Closed

 Description   

5.5 is slower than 5.3 on a DBT-3 query#1, MyISAM storage engine.
Profiling shows that 5.5 does many str_to_datetime calls.

The query:

select
        l_returnflag,
        l_linestatus,
        sum(l_quantity) as sum_qty,
        sum(l_extendedprice) as sum_base_price,
        sum(l_extendedprice * (1 - l_discount)) as sum_disc_price,
        sum(l_extendedprice * (1 - l_discount) * (1 + l_tax)) as sum_charge,
        avg(l_quantity) as avg_qty,
        avg(l_extendedprice) as avg_price,
        avg(l_discount) as avg_disc,
        count(*) as count_order
from
        lineitem
where
        l_shipdate <= date_sub('1998-12-01', interval 79 day)
group by
        l_returnflag,
        l_linestatus
order by
        l_returnflag,
        l_linestatus;

See comments to MDEV-4150 for analysis. MySQL-5.5's "constant item caching" interferes with get_datetime_value()'s caching mechanism, as a result, datetime value is cached in its string form, and we get string->datetime conversion done for every row.



 Comments   
Comment by Sergei Petrunia [ 2013-03-11 ]

Small dataset for debugging. Performance difference can be observed on a big dataset.

Generated at Thu Feb 08 06:55:05 UTC 2024 using Jira 8.20.16#820016-sha1:9d11dbea5f4be3d4cc21f03a88dd11d8c8687422.