[MCOL-902] Group_concat() performance and gettrace() elapsed time Created: 2017-08-31  Updated: 2020-08-25  Resolved: 2018-01-18

Status: Closed
Project: MariaDB ColumnStore
Component/s: Documentation
Affects Version/s: 1.0.11
Fix Version/s: Icebox

Type: Bug Priority: Major
Reporter: Daniel Lee (Inactive) Assignee: Andrew Hutchings (Inactive)
Resolution: Fixed Votes: 1
Labels: None

Issue Links:
Relates
relates to MCOL-965 group_contact with order by on joined... Closed
Sprint: 2017-19, 2017-20, 2017-24

 Description   

Build tested: 1.0.11-1


Query Stats: MaxMemPct-13; NumTempFiles-0; TempFileSpace-0B; ApproxPhyI/O-0; CacheI/O-1611421; BlocksTouched-1611421; PartitionBlocksEliminated-0; MsgBytesIn-12GB; MsgBytesOut-1MB; Mode-Distributed

Desc Mode Table TableOID ReferencedColumns PIO LIO PBE Elapsed Rows
AAA PM b 6955 (col1,col2) 0 42 0 0.006 42261
AAA PM a 6965 (col3,col2,col4) 0 1611379 0 153.791 942885171
BBB PM a-b 6965 - - - - ----- -
CCC UM - - - - - - 153.812 22311

From this it seems the elapsed time is 154seconds, yet fetching the data is taking 600 seconds, with intermittent low traffic on the network (we are on 10G), the server is showing ExeMGR at 100%.


Gettrace reported elapsed time of 154 seconds, but the query actually took 600 seconds to finished.

1) Is gettrace() reporting the correct elapsed time?
2) Elapsed time for what processes or steps are not being included in the gettrace() output?

There is another ticket, MCOL-901, opened against group_concat() for its excessive memory consumption.

Using a VM with 60gb memory, I did similar tests using a 1gb dbt3 database.

select l_orderkey, group_concat(l_partkey) from t1 group by l_orderkey;

1500000 rows in set, 1 warning (3 min 56.94 sec)

Desc Mode Table TableOID ReferencedColumns PIO LIO PBE Elapsed Rows
AAA PM t1 3092 (l_orderkey,l_partkey) 5870 5886 0 202.183 6001215
CCC UM - - - - - - 231.155 1500000

-----------------------------------------------------------+

Query Stats: MaxMemPct-68; NumTempFiles-0; TempFileSpace-0B; ApproxPhyI/O-5870; CacheI/O-5886; BlocksTouched-5866; PartitionBlocksEliminated-0; MsgBytesIn-57MB; MsgBytesOut-2KB; Mode-Distributed

----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
1 row in set (0.01 sec)

select l_orderkey, group_concat(l_partkey order by o_custkey separator '') as g from t1, t2 where l_orderkey = o_orderkey group by l_orderkey;

1500000 rows in set, 1 warning (4 min 13.48 sec)

MariaDB [tpch1]> select calgettrace();
----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------

calgettrace()

----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------

Desc Mode Table TableOID ReferencedColumns PIO LIO PBE Elapsed Rows
AAA PM t2 3044 (o_custkey,o_orderkey) 1474 1486 0 0.102 1500000
AAA PM t1 3092 (l_orderkey,l_partkey) 0 5866 0 215.113 6001215
BBB PM t3 3092 - - - - ----- -
CCC UM - - - - - - 244.862 1500000

----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
1 row in set (0.01 sec)

MariaDB [tpch1]> select calgetstats();
------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------

calgetstats()

------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------

Query Stats: MaxMemPct-72; NumTempFiles-0; TempFileSpace-0B; ApproxPhyI/O-1474; CacheI/O-7352; BlocksTouched-7336; PartitionBlocksEliminated-0; MsgBytesIn-140MB; MsgBytesOut-17MB; Mode-Distributed

------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
1 row in set (0.00 sec)

MariaDB [tpch1]> select l_orderkey, group_concat(replace(replace(l_partkey,3,1),4,1) order by o_custkey separator '') as g from t1, t2 where l_orderkey = o_orderkey group by l_orderkey;

1500000 rows in set, 1 warning (5 min 15.17 sec)

MariaDB [tpch1]> select calgettrace();
-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------

calgettrace()

-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------

Desc Mode Table TableOID ReferencedColumns PIO LIO PBE Elapsed Rows
AAA PM t2 3044 (o_custkey,o_orderkey) 0 1470 0 0.133 1500000
AAA PM t1 3092 (l_orderkey,l_partkey) 0 5866 0 262.193 6001215
BBB PM t3 3092 - - - - ----- -
CCC UM - - - - - - 280.540 1500000

-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
1 row in set (0.01 sec)

MariaDB [tpch1]> select calgetstats();
---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------

calgetstats()

---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------

Query Stats: MaxMemPct-81; NumTempFiles-0; TempFileSpace-0B; ApproxPhyI/O-0; CacheI/O-7336; BlocksTouched-7336; PartitionBlocksEliminated-0; MsgBytesIn-149MB; MsgBytesOut-31MB; Mode-Distributed

---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
1 row in set (0.00 sec)

With 2gb of dbt3 data.

MariaDB [tpch1]> select l_orderkey, group_concat(replace(replace(l_partkey,3,1),4,1) order by o_custkey separator '') as g from t1, t2 where l_orderkey = o_orderkey group by l_orderkey;

1500000 rows in set, 1 warning (11 min 3.55 sec)

MariaDB [tpch1]> select calgettrace();
---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------

calgettrace()

---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------

Desc Mode Table TableOID ReferencedColumns PIO LIO PBE Elapsed Rows
AAA PM t2 3044 (o_custkey,o_orderkey) 0 1470 0 0.100 1500000
AAA PM t1 3092 (l_orderkey,l_partkey) 0 11729 0 599.220 12002430
BBB PM t3 3092 - - - - ----- -
CCC UM - - - - - - 605.390 1500000

---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
1 row in set (0.01 sec)

MariaDB [tpch1]> select calgetstats();
-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------

calgetstats()

-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------

Query Stats: MaxMemPct-80; NumTempFiles-0; TempFileSpace-0B; ApproxPhyI/O-0; CacheI/O-13199; BlocksTouched-13199; PartitionBlocksEliminated-0; MsgBytesIn-283MB; MsgBytesOut-31MB; Mode-Distributed

-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
1 row in set (0.01 sec)



 Comments   
Comment by David Thompson (Inactive) [ 2017-12-11 ]

This is still not actionable at this point so removing from sprint and 1.0.12.

Comment by Andrew Hutchings (Inactive) [ 2018-01-18 ]

This has been difficult to reproduce to the magnitude observed. We are pretty certain the time difference can be attributed to either:

1. Excessive execution time in mysqld. In theory this could be measured using MariaDB's performance metrics if the problem could be reproduced. Swapping could cause this or some kind of timeout.
2. Slow network between ExeMgr and mysqld (in a multi-UM environment)
3. A clock shift on the server

As a resolution for now I have modified the following document to add a note that the execution time inside mysqld is not recorded using these functions:

https://mariadb.com/kb/en/library/analyzing-queries-in-columnstore/

If this is discovered again and is decided that it is not due to the three above we can reopen this ticket or create a new one.

Generated at Thu Feb 08 02:24:40 UTC 2024 using Jira 8.20.16#820016-sha1:9d11dbea5f4be3d4cc21f03a88dd11d8c8687422.