Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit062b032

Browse files
committed
Update README.md
1 parent35d8331 commit062b032

File tree

1 file changed

+12
-1
lines changed

1 file changed

+12
-1
lines changed

‎README.md

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,11 +42,22 @@ set sr_plan.write_mode = false;
4242
```
4343
Now verify that your query is saved:
4444
```SQL
45-
select query_hash, enable, query, explain_jsonb_plan(plan)from sr_plans;
45+
select query_hash, enable,valid,query, explain_jsonb_plan(plan)from sr_plans;
4646
```
4747
explain_jsonb_plan function allows you to display explain execute the plan of which lies in jsonb. By default, all the plans are off, you need enable it:
4848
```SQL
4949
update sr_plansset enable=truewhere query_hash=812619660;
5050
```
5151
(812619660 for example only)
5252
After that, the plan for the query will be taken from the sr_plans.
53+
54+
In addition sr plan allows you to save a parameterized query plan. In this case, we have some constants in the query are not essential.
55+
For the parameters we use a special function_p (anyelement) example:
56+
```SQL
57+
select query_hashfrom sr_planswhere query_hash=1000+_p(10);
58+
```
59+
if we keep the plan for the query and enable it to be used also for the following queries:
60+
```SQL
61+
select query_hashfrom sr_planswhere query_hash=1000+_p(11);
62+
select query_hashfrom sr_planswhere query_hash=1000+_p(-5);
63+
```

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp