Bug #99714 | Updates to JSON column type are not | ||
---|---|---|---|
Submitted: | 28 May 2020 3:30 | Modified: | 3 Jul 2020 17:51 |
Reporter: | Noah Zucker | Email Updates: | |
Status: | Not a Bug | Impact on me: | |
Category: | MySQL Server: InnoDB storage engine | Severity: | S3 (Non-critical) |
Version: | 8.0.15 | OS: | Linux |
Assigned to: | CPU Architecture: | Any |
[28 May 2020 3:30]
Noah Zucker
[28 May 2020 3:31]
Noah Zucker
https://mysqlserverteam.com/partial-update-of-json-values/
[28 May 2020 8:24]
Frederic Descamps
I've tried to reproduce this on the latest MySQL (8.0.20), and I don't see such behavior: I used the following bash script for n in `seq 1 100000`; do mysqlsh root@localhost/test --sql -e "UPDATE tasks SET doc = JSON_SET(doc, '$.a', $n) WHERE id =1" >/dev/null 2>&1; done The size didn't change: -rw-r----- 1 mysql mysql 112K May 28 08:50 /var/lib/mysql/test/tasks.ibd -rw-r----- 1 mysql mysql 112K May 28 10:12 /var/lib/mysql/test/tasks.ibd
[28 May 2020 9:27]
MySQL Verification Team
Please see last comment and try 8.0.20. Thanks.
[28 May 2020 15:33]
Noah Zucker
Thank you, I'm going to test with local mysql in 8.0.15 and then 8.0.20
[1 Jun 2020 13:23]
MySQL Verification Team
Hi Mr. Zucker, Thank you for your bug report. However, I do not think that this is a bug. InnoDB does use lot's of space and only dump / restore or OPTIMIZE can revoke that space. There is no other way of accomplishing that. Also, for reporting on the number of rows, size of the tablespace and other statistics, send us data from the INFORMATION_SCHEMA. That info is much closer to real data then the one that you have used. To report a bug, hence use I_S or P_S respectively.
[2 Jul 2020 1:00]
Bugs System
No feedback was provided for this bug for over a month, so it is being suspended automatically. If you are able to provide the information that was originally requested, please do so and change the status of the bug back to "Open".
[3 Jul 2020 17:51]
Noah Zucker
Since opening this report I've since set our DB to run OPTIMIZE on a weekly schedule. I agree it'd not a bug, but it seems to me that there is some room for improvement / optimization of how InnoDB stores data / updates to JSON column types. I'm fine with closing this ticket.
[6 Jul 2020 12:01]
MySQL Verification Team
Thank you, Mr. Zucker.