[MDEV-29889] mysqldump --tab --header is slow Created: 2022-10-26  Updated: 2023-01-03  Resolved: 2023-01-03

Status: Closed
Project: MariaDB Server
Component/s: Scripts & Clients
Affects Version/s: 10.11.1
Fix Version/s: 10.11.2, 11.0.1

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

Issue Links:
Problem/Incident
is caused by MDEV-22200 mysqldump client: --tab export with c... Closed
Relates
relates to MDEV-12879 Please add support for exporting colu... Open

 Description   

mysqldump --header --tab wraps the dumping SELECT in UNION ALL + ORDER BY. Which means a filesort (try EXPLAIN), that would make mysqldump notably slower on large tables. This is completely unnecessary, because the ordering of table rows is unimportant.



 Comments   
Comment by Rui Alves [ 2022-10-26 ]

The ORDER BY that I implemented on the MDEV-22200 has two purposes:

1. By using a temporary dummy binary sorting variable (0 when at the header row, 1 otherwise) it enforces the header row on the top and prevents it from getting messed up somewhere in the middle of the data rows.

2. The ordering of data rows is necessary to enforce compability with the --order-by-primary clause.

Comment by Daniel Black [ 2022-10-28 ]

MDEV-12879 as option.

Comment by Sergei Golubchik [ 2022-12-28 ]

https://github.com/MariaDB/server/pull/2311/commits/b4d1ff1d3b262a35c1d83acf893544de9ccdaad0 is ok to push

Generated at Thu Feb 08 10:12:03 UTC 2024 using Jira 8.20.16#820016-sha1:9d11dbea5f4be3d4cc21f03a88dd11d8c8687422.