[MCOL-5141] ha_mcs_impl_select_next suffers from a needless asign operator call Created: 2022-06-16  Updated: 2023-12-15

Status: Open
Project: MariaDB ColumnStore
Component/s: MDB Plugin
Affects Version/s: 6.3.1
Fix Version/s: Icebox

Type: New Feature Priority: Major
Reporter: Roman Assignee: Max Mether
Resolution: Unresolved Votes: 0
Labels: performance


 Description   

ha_mcs_impl_select_next() function is called on every row. Its code is in dbcon/mysql/ha_mcs_impl.cpp around the line 5295 defines cal_table_info ti and then assigns to it that triggers assign op that copies complex structures. According with the perf report output I see 15% wasted by a combination of cal_table_info ctor and cal_table_info::operator=. See the screen attached. This is a part of perf record of MDB process taken with SELECT..INSERT for a table with at least 50 000 000 records.
The suggested solution is to avoid doing the expensive std::stack<shared_pointer> copies.
JFYI cal_table_info::tpl_scan_ctx_st is processing UNIONs and table execution paths.


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