forked frompostgres/postgres
- Notifications
You must be signed in to change notification settings - Fork6
Commited934d4
committed
Allow estimate_num_groups() to pass back further details about the estimation
Here we add a new output parameter to estimate_num_groups() to allow it toinform the caller of additional, possibly useful information about theestimation.The new output parameter is a struct that currently contains just a singlefield with a set of flags. This was done rather than having the flags asan output parameter to allow future fields to be added without having tochange the signature of the function at a later date when we want to passback further information that might not be suitable to store in the flagsfield.It seems reasonable that one day in the future that the planner would wantto know more about the estimation. For example, how many individual setsof statistics was the estimation generated from? The planner may want totake that into account if we ever want to consider risks as well as costswhen generating plans.For now, there's only 1 flag we set in the flags field. This is toindicate if the estimation fell back on using the hard-coded constants inany part of the estimation. Callers may like to change their behavior ifthis is set, and this gives them the ability to do so. Callers may passthe flag pointer as NULL if they have no interest in obtaining anyadditional information about the estimate.We're not adding any actual usages of these flags here. Some follow-upcommits will make use of this feature. Additionally, we're also notmaking any changes to add support for clauselist_selectivity() andclauselist_selectivity_ext(). However, if this is required in the futurethen the same struct being added here should be fine to use as a newoutput argument for those functions too.Author: David RowleyDiscussion:https://postgr.es/m/CAApHDvqQqpk=1W-G_ds7A9CsXX3BggWj_7okinzkLVhDubQzjA@mail.gmail.com1 parentefd9d92 commited934d4
File tree
8 files changed
+49
-8
lines changed- contrib/postgres_fdw
- src
- backend
- optimizer
- path
- plan
- prep
- util
- utils/adt
- include/utils
8 files changed
+49
-8
lines changedLines changed: 1 addition & 1 deletion
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
3087 | 3087 |
| |
3088 | 3088 |
| |
3089 | 3089 |
| |
3090 |
| - | |
| 3090 | + | |
3091 | 3091 |
| |
3092 | 3092 |
| |
3093 | 3093 |
| |
|
Lines changed: 2 additions & 1 deletion
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
1969 | 1969 |
| |
1970 | 1970 |
| |
1971 | 1971 |
| |
1972 |
| - | |
| 1972 | + | |
| 1973 | + | |
1973 | 1974 |
| |
1974 | 1975 |
| |
1975 | 1976 |
| |
|
Lines changed: 1 addition & 0 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
1990 | 1990 |
| |
1991 | 1991 |
| |
1992 | 1992 |
| |
| 1993 | + | |
1993 | 1994 |
| |
1994 | 1995 |
| |
1995 | 1996 |
| |
|
Lines changed: 6 additions & 4 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
3702 | 3702 |
| |
3703 | 3703 |
| |
3704 | 3704 |
| |
3705 |
| - | |
| 3705 | + | |
| 3706 | + | |
3706 | 3707 |
| |
3707 | 3708 |
| |
3708 | 3709 |
| |
| |||
3727 | 3728 |
| |
3728 | 3729 |
| |
3729 | 3730 |
| |
3730 |
| - | |
| 3731 | + | |
| 3732 | + | |
3731 | 3733 |
| |
3732 | 3734 |
| |
3733 | 3735 |
| |
| |||
3743 | 3745 |
| |
3744 | 3746 |
| |
3745 | 3747 |
| |
3746 |
| - | |
| 3748 | + | |
3747 | 3749 |
| |
3748 | 3750 |
| |
3749 | 3751 |
| |
| |||
4792 | 4794 |
| |
4793 | 4795 |
| |
4794 | 4796 |
| |
4795 |
| - | |
| 4797 | + | |
4796 | 4798 |
| |
4797 | 4799 |
| |
4798 | 4800 |
| |
|
Lines changed: 1 addition & 0 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
338 | 338 |
| |
339 | 339 |
| |
340 | 340 |
| |
| 341 | + | |
341 | 342 |
| |
342 | 343 |
| |
343 | 344 |
| |
|
Lines changed: 1 addition & 0 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
1713 | 1713 |
| |
1714 | 1714 |
| |
1715 | 1715 |
| |
| 1716 | + | |
1716 | 1717 |
| |
1717 | 1718 |
| |
1718 | 1719 |
| |
|
Lines changed: 21 additions & 1 deletion
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
3241 | 3241 |
| |
3242 | 3242 |
| |
3243 | 3243 |
| |
| 3244 | + | |
3244 | 3245 |
| |
3245 | 3246 |
| |
3246 | 3247 |
| |
| |||
3287 | 3288 |
| |
3288 | 3289 |
| |
3289 | 3290 |
| |
| 3291 | + | |
3290 | 3292 |
| |
3291 | 3293 |
| |
3292 | 3294 |
| |
| |||
3311 | 3313 |
| |
3312 | 3314 |
| |
3313 | 3315 |
| |
| 3316 | + | |
| 3317 | + | |
| 3318 | + | |
| 3319 | + | |
| 3320 | + | |
| 3321 | + | |
3314 | 3322 |
| |
3315 | 3323 |
| |
3316 | 3324 |
| |
| |||
3358 | 3366 |
| |
3359 | 3367 |
| |
3360 | 3368 |
| |
3361 |
| - | |
| 3369 | + | |
3362 | 3370 |
| |
3363 | 3371 |
| |
3364 | 3372 |
| |
3365 | 3373 |
| |
3366 | 3374 |
| |
3367 | 3375 |
| |
3368 | 3376 |
| |
| 3377 | + | |
| 3378 | + | |
| 3379 | + | |
| 3380 | + | |
3369 | 3381 |
| |
3370 | 3382 |
| |
3371 | 3383 |
| |
| |||
3577 | 3589 |
| |
3578 | 3590 |
| |
3579 | 3591 |
| |
| 3592 | + | |
| 3593 | + | |
| 3594 | + | |
| 3595 | + | |
| 3596 | + | |
| 3597 | + | |
| 3598 | + | |
| 3599 | + | |
3580 | 3600 |
| |
3581 | 3601 |
| |
3582 | 3602 |
| |
|
Lines changed: 16 additions & 1 deletion
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
68 | 68 |
| |
69 | 69 |
| |
70 | 70 |
| |
| 71 | + | |
| 72 | + | |
| 73 | + | |
| 74 | + | |
| 75 | + | |
| 76 | + | |
| 77 | + | |
| 78 | + | |
| 79 | + | |
| 80 | + | |
| 81 | + | |
| 82 | + | |
| 83 | + | |
| 84 | + | |
71 | 85 |
| |
72 | 86 |
| |
73 | 87 |
| |
| |||
197 | 211 |
| |
198 | 212 |
| |
199 | 213 |
| |
200 |
| - | |
| 214 | + | |
| 215 | + | |
201 | 216 |
| |
202 | 217 |
| |
203 | 218 |
| |
|
0 commit comments
Comments
(0)