matrixone icon indicating copy to clipboard operation
matrixone copied to clipboard

[Bug]: update_index/delete/write_only/read_write will cause mo out of memory on table with index and 1000w basic data

Open aressu1985 opened this issue 2 years ago • 7 comments

Is there an existing issue for the same bug?

  • [X] I have checked the existing issues.

Branch Name

main

Commit ID

32a05ab

Other Environment Information

- Hardware parameters:64C 256G
- OS type:
- Others:

Actual Behavior

on standlone mode, update_index/delete/write_only/read_write will cause mo out of memory on table with index and 1000w basic data

image image

prof and heap: update_index_1000w.tar.gz

Expected Behavior

No response

Steps to Reproduce

1. run a mo standlone mode,and create two databases:sysbench_1000w_no_auto_no_index,sysbench_1000w_no_auto_index
2. git clone https://github.com/matrixorigin/mo-sysbench.git
3. prepare data:
sysbench --mysql-host=127.0.0.1 --mysql-port=6001 --mysql-user=dump --mysql-password='111' oltp_common.lua --mysql-db=sysbench_1000w_no_auto_index  --tables=10 cleanup
sysbench --mysql-host=127.0.0.1 --mysql-port=6001 --mysql-user=dump --mysql-password='111' oltp_common.lua --mysql-db=sysbench_1000w_no_auto_index --auto_inc=off --tables=10 --table_size=1000000 --threads=10  prepare

sysbench --mysql-host=127.0.0.1 --mysql-port=6001 --mysql-user=dump --mysql-password='111' oltp_common.lua --mysql-db=sysbench_1000w_no_auto_no_index --create_secondary=off  --tables=10 cleanup
sysbench --mysql-host=127.0.0.1 --mysql-port=6001 --mysql-user=dump --mysql-password='111' oltp_common.lua --mysql-db=sysbench_1000w_no_auto_no_index --auto_inc=off --create_secondary=off --tables=10 --table_size=1000000 --threads=10  prepare

4.run test
[no index]
sysbench  --mysql-host=127.0.0.1 --mysql-port=6001 --mysql-user=dump --mysql-password=111 --db-ps-mode=disable oltp_update_index.lua --mysql-db=sysbench_1000w_no_auto_no_index --tables=10 --table_size=10000000 --time=60 --report-interval=2 --threads=100  run

sysbench  --mysql-host=127.0.0.1 --mysql-port=6001 --mysql-user=dump --mysql-password=111 --db-ps-mode=disable oltp_write_only.lua --mysql-db=sysbench_1000w_no_auto_no_index --tables=10 --table_size=10000000  --time=60 --report-interval=2 --skip_trx=off --threads=100 run

sysbench  --mysql-host=127.0.0.1 --mysql-port=6001 --mysql-user=dump --mysql-password=111 --db-ps-mode=disable oltp_read_write.lua --mysql-db=sysbench_1000w_no_auto_no_index --tables=10 --table_size=10000000  --time=60 --report-interval=2 --threads=100 run

sysbench  --mysql-host=127.0.0.1 --mysql-port=6001 --mysql-user=dump --mysql-password=111 --db-ps-mode=disable oltp_delete.lua --mysql-db=sysbench_1000w_no_auto_no_index --tables=10 --table_size=10000000  --time=60 --report-interval=2 --threads=100 run

[with index]
sysbench  --mysql-host=127.0.0.1 --mysql-port=6001 --mysql-user=dump --mysql-password=111 --db-ps-mode=disable oltp_update_index.lua --mysql-db=sysbench_1000w_no_auto_index --tables=10 --table_size=10000000 --time=60 --report-interval=2 --threads=100  run 

sysbench  --mysql-host=127.0.0.1 --mysql-port=6001 --mysql-user=dump --mysql-password=111 --db-ps-mode=disable oltp_write_only.lua --mysql-db=sysbench_1000w_no_auto_index --tables=10 --table_size=10000000  --time=60 --report-interval=2 --skip_trx=off --threads=100 run

sysbench  --mysql-host=127.0.0.1 --mysql-port=6001 --mysql-user=dump --mysql-password=111 --db-ps-mode=disable oltp_read_write.lua --mysql-db=sysbench_1000w_no_auto_index --tables=10 --table_size=10000000  --time=60 --report-interval=2 --threads=100 run

sysbench  --mysql-host=127.0.0.1 --mysql-port=6001 --mysql-user=dump --mysql-password=111 --db-ps-mode=disable oltp_delete.lua --mysql-db=sysbench_1000w_no_auto_index --tables=10 --table_size=10000000  --time=60 --report-interval=2 --threads=100 run

Additional information

No response

aressu1985 avatar Jan 25 '24 07:01 aressu1985

image Seems like a storage issue, could you please kindly take a look? Thanks a lot. @XuPeng-SH

aronchanisme avatar Jan 29 '24 04:01 aronchanisme

Prepare 100w data and explain analyze update on the secondary index column k

> explain analyze UPDATE sbtest2 SET k=k+1 WHERE id=497892;

WeChatWorkScreenshot_fbb15794-2bf3-441c-9d4c-10e82eb4cc8a

It will always scan all the table data on the secondary index table.

XuPeng-SH avatar Jan 31 '24 15:01 XuPeng-SH

As talked with @aunjgr, we need to optimize with runtime filter

XuPeng-SH avatar Feb 01 '24 01:02 XuPeng-SH

在解决中移物联的issue

aunjgr avatar Feb 22 '24 12:02 aunjgr

需要手动交换join左右,以及添加runtime filter

aunjgr avatar Feb 28 '24 10:02 aunjgr

not working on it today

aunjgr avatar Mar 04 '24 12:03 aunjgr

not working on it today

aunjgr avatar Mar 08 '24 11:03 aunjgr

已被 #14856 修复,且与 matrixorigin/MO-Cloud#2603 重复

aunjgr avatar Mar 14 '24 06:03 aunjgr

testing

aressu1985 avatar Mar 19 '24 02:03 aressu1985

confirm,closed commit:47b7ee82f41fa63573e8025bc947e9d7c479129b job:https://github.com/matrixorigin/mo-nightly-regression/actions/runs/8524292804/job/23348752769 企业微信截图_1eb9a224-9040-4fc6-b99f-03076ad61f1b

heni02 avatar Apr 03 '24 02:04 heni02