-
Notifications
You must be signed in to change notification settings - Fork 5.8k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
tidb fails to pushdown json_extract
resulting in querry oom or server crash
#48981
Comments
Hi @0xdeafbeef , thanks for the report. First I want to give a quick answer to the question about why the same query sometimes got canceled and sometimes crashed (by OS's oom-killer). Our memory tracking mechanism will trigger query canceling if it detects the memory consumption is exceeding the specified memory limit, but that cancel action can be later than OS seeing the TiDB process is using up the system's physical memory. That's why crash can happen. Now about the push down. There are several aspects to consider:
We'll be adding push down support for |
@zanmato1984 thank you for detailed answer! I think the absence of For example, SELECT root_hash
FROM blocks
WHERE workchain = -1
AND shard = 0x8000000000000000
AND UNHEX(HEX(file_hash)) = 0x0000000
LIMIT 1; it gives the same plan. But memory usage during 0e2568b4f83ea4a007d589652c090ed695b8a6315cc6b7039647f6ba4a895601.txt |
The filter push down is actually a "all-or-nothing" situation, meaning that any unsupported function nested in any level of an expression tree will effectively block the whole expression tree to be pushed down.
I would think otherwise. I guess it's the time-consuming json functions in |
1. Minimal reproduce step (Required)
ddebbdd3fb95f2b16335f77890ad99b1ddec5992a4670105079a6a768c36bd5c.txt
using
reduces memory usage from 8gb to 980kb
be3ba3f6fe2722f7b62db5fc771750f47e5484ba9426644ca165b25fe8113c9e.txt
2. What did you expect to see? (Required)
I expected a simple streaming search with
JSON_UNQUOTE
filter pushed down to tikv, which successfully was done with tiflash.3. What did you see instead (Required)
Server with version
crashes with oom.
I have no info about memory usage because of the crash, but it has same execution plan.
4. What is your TiDB version? (Required)
The text was updated successfully, but these errors were encountered: