[MDEV-25332] Debug server is extremely slow upon ANALYZE FORMAT=JSON with long literals Created: 2021-04-02  Updated: 2023-04-27

Status: Open
Project: MariaDB Server
Component/s: Debug, Optimizer
Affects Version/s: 10.2, 10.3, 10.4, 10.5, 10.6
Fix Version/s: 10.4, 10.5

Type: Bug Priority: Minor
Reporter: Elena Stepanova Assignee: Sergei Petrunia
Resolution: Unresolved Votes: 0
Labels: slow-debug

Issue Links:
Relates
relates to MDEV-24909 JSON functions don't respect KILL QUE... Closed

 Description   

ANALYZE FORMAT=JSON SELECT ... below takes very long time on a debug server (> 1min). Also, it doesn't respect KILL QUERY / max_statement_time limit and remains in "Killed" state holding the table.

On a release server the same query is instantaneous.

I fully realize that debug server is bound to be slower, but I think it's worth checking, when/if priorities permit, whether it should be that much slower.

The SELECT itself, without ANALYZE, is very fast both on debug and non-debug (less than 1 second).

Warning: ANALYZE FORMAT=JSON prints the final generated value of REPEAT('x',50000000), so it will flood the screen and scroll-back history unless you suppress the output or redirect it somewhere.

Important: The test needs to be run with max-allowed-packet=128M or alike. If you run it via MTR, it's --mysqld=--max-allowed-packet=128M. If you run it via command-line client, the option max-allowed-packet=128M should be passed both to the server and to the client.

CREATE OR REPLACE TABLE t1 (a VARCHAR(8));
INSERT INTO t1 VALUES ('foo'),('bar'),('qux');
ANALYZE FORMAT=JSON SELECT * FROM t1 WHERE STRCMP(REPEAT('x',50000000),a);

10.6 1bd41158 debug

1 row in set (1 min 5.502 sec)

10.6 1bd41158 non-debug

1 row in set (0.432 sec)


Generated at Thu Feb 08 09:36:54 UTC 2024 using Jira 8.20.16#820016-sha1:9d11dbea5f4be3d4cc21f03a88dd11d8c8687422.