forked frompostgres/postgres
- Notifications
You must be signed in to change notification settings - Fork6
Commit77aebe9
committed
SQL/JSON: Avoid initializing unnecessary ON ERROR / ON EMPTY steps
When the ON ERROR / ON EMPTY behavior is to return NULL, returningNULL directly from ExecEvalJsonExprPath() suffices. Therefore, there'sno need to create separate steps to check the error/empty flag orthose to evaluate the the constant NULL expression. This speeds upcommon cases because the default ON ERROR / ON EMPTY behavior forJSON_QUERY() and JSON_VALUE() is to return NULL. However, these stepsare necessary if the RETURNING type is a domain, as constraints on thedomain may need to be checked.Reported-by: Jian He <jian.universality@gmail.com>Author: Jian He <jian.universality@gmail.com>Author: Amit Langote <amitlangote09@gmail.com>Discussion:https://postgr.es/m/CACJufxEo4sUjKCYtda0_qt9tazqqKPmF1cqhW9KBOUeJFqQd2g@mail.gmail.comBackpatch-through: 171 parentcd6b2ae commit77aebe9
2 files changed
+34
-12
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
4233 | 4233 | | |
4234 | 4234 | | |
4235 | 4235 | | |
4236 | | - | |
4237 | | - | |
4238 | | - | |
| 4236 | + | |
| 4237 | + | |
| 4238 | + | |
| 4239 | + | |
| 4240 | + | |
4239 | 4241 | | |
4240 | 4242 | | |
4241 | 4243 | | |
| |||
4313 | 4315 | | |
4314 | 4316 | | |
4315 | 4317 | | |
| 4318 | + | |
| 4319 | + | |
| 4320 | + | |
4316 | 4321 | | |
4317 | 4322 | | |
4318 | 4323 | | |
| |||
4384 | 4389 | | |
4385 | 4390 | | |
4386 | 4391 | | |
| 4392 | + | |
| 4393 | + | |
| 4394 | + | |
| 4395 | + | |
| 4396 | + | |
| 4397 | + | |
| 4398 | + | |
4387 | 4399 | | |
4388 | | - | |
4389 | | - | |
| 4400 | + | |
| 4401 | + | |
| 4402 | + | |
| 4403 | + | |
4390 | 4404 | | |
4391 | 4405 | | |
4392 | 4406 | | |
| |||
4441 | 4455 | | |
4442 | 4456 | | |
4443 | 4457 | | |
| 4458 | + | |
| 4459 | + | |
| 4460 | + | |
4444 | 4461 | | |
4445 | 4462 | | |
4446 | | - | |
| 4463 | + | |
| 4464 | + | |
| 4465 | + | |
| 4466 | + | |
4447 | 4467 | | |
4448 | 4468 | | |
4449 | 4469 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
4414 | 4414 | | |
4415 | 4415 | | |
4416 | 4416 | | |
4417 | | - | |
4418 | | - | |
| 4417 | + | |
| 4418 | + | |
4419 | 4419 | | |
4420 | 4420 | | |
4421 | 4421 | | |
| |||
4424 | 4424 | | |
4425 | 4425 | | |
4426 | 4426 | | |
4427 | | - | |
4428 | | - | |
| 4427 | + | |
| 4428 | + | |
| 4429 | + | |
4429 | 4430 | | |
4430 | 4431 | | |
4431 | 4432 | | |
| |||
4445 | 4446 | | |
4446 | 4447 | | |
4447 | 4448 | | |
4448 | | - | |
| 4449 | + | |
4449 | 4450 | | |
4450 | 4451 | | |
4451 | 4452 | | |
4452 | 4453 | | |
4453 | 4454 | | |
4454 | 4455 | | |
4455 | | - | |
| 4456 | + | |
| 4457 | + | |
4456 | 4458 | | |
4457 | 4459 | | |
4458 | 4460 | | |
| |||
0 commit comments
Comments
(0)