forked frompostgres/postgres
- Notifications
You must be signed in to change notification settings - Fork6
Commit31b6606
committed
Make concurrent refresh check early that there is a unique index on matview.
In REFRESH MATERIALIZED VIEW command, CONCURRENTLY option is onlyallowed if there is at least one unique index with no WHERE clause onone or more columns of the matview. Previously, concurrent refreshchecked the existence of a unique index on the matview after fillingthe data to new snapshot, i.e., after calling refresh_matview_datafill().So, when there was no unique index, we could need to wait a long timebefore we detected that and got the error. It was a waste of time.To eliminate such wasting time, this commit changes concurrent refreshso that it checks the existence of a unique index at the beginning ofthe refresh operation, i.e., before starting any time-consuming jobs.If CONCURRENTLY option is not allowed due to lack of a unique index,concurrent refresh can immediately detect it and emit an error.Author: Masahiko SawadaReviewed-by: Michael Paquier, Fujii Masao1 parent57c9324 commit31b6606
1 file changed
+53
-6
lines changedLines changed: 53 additions & 6 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
216 | 216 |
| |
217 | 217 |
| |
218 | 218 |
| |
| 219 | + | |
| 220 | + | |
| 221 | + | |
| 222 | + | |
| 223 | + | |
| 224 | + | |
| 225 | + | |
| 226 | + | |
| 227 | + | |
| 228 | + | |
| 229 | + | |
| 230 | + | |
| 231 | + | |
| 232 | + | |
| 233 | + | |
| 234 | + | |
| 235 | + | |
| 236 | + | |
| 237 | + | |
| 238 | + | |
| 239 | + | |
| 240 | + | |
| 241 | + | |
| 242 | + | |
| 243 | + | |
| 244 | + | |
| 245 | + | |
| 246 | + | |
| 247 | + | |
| 248 | + | |
| 249 | + | |
| 250 | + | |
| 251 | + | |
| 252 | + | |
| 253 | + | |
| 254 | + | |
| 255 | + | |
| 256 | + | |
| 257 | + | |
| 258 | + | |
| 259 | + | |
| 260 | + | |
| 261 | + | |
| 262 | + | |
| 263 | + | |
219 | 264 |
| |
220 | 265 |
| |
221 | 266 |
| |
| |||
695 | 740 |
| |
696 | 741 |
| |
697 | 742 |
| |
698 |
| - | |
699 |
| - | |
700 |
| - | |
701 |
| - | |
702 |
| - | |
703 |
| - | |
| 743 | + | |
| 744 | + | |
| 745 | + | |
| 746 | + | |
| 747 | + | |
| 748 | + | |
| 749 | + | |
| 750 | + | |
704 | 751 |
| |
705 | 752 |
| |
706 | 753 |
| |
|
0 commit comments
Comments
(0)