forked frompostgres/postgres
- Notifications
You must be signed in to change notification settings - Fork6
Commit2ddedca
committed
Reduce match_pattern_prefix()'s dependencies on index opfamilies.
Historically, the planner's LIKE/regex index optimizations were onlycarried out for specific index opfamilies. That's never been a greatidea from the standpoint of extensibility, but it didn't matter somuch as long as we had no practical way to extend such behaviors anyway.With the addition of planner support functions, and in view of ongoingwork to support additional table and index AMs, it seems like a goodtime to relax this.Hence, recast the decisions in match_pattern_prefix() so that ratherthan decide which operators to generate by looking at what the indexopfamily contains, we decide which operators to generate a-prioriand then see if the opfamily supports them. This is much moredefensible from a semantic standpoint anyway, since we know thesemantics of the chosen operators precisely, and we only need toassume that the opfamily correctly implements operators it claimsto support.The existing "pattern" opfamilies put a crimp in this approach, sincewe need to select the pattern operators if we want those to work.So we still have to special-case those opfamilies. But that seemsall right, since in view of the addition of collations, the patternopfamilies seem like a legacy hack that nobody will be building on.The only immediate effect of this change, so far as the core code isconcerned, is that anchored LIKE/regex patterns can be mapped ontoBRIN index searches, and exact-match patterns can be mapped onto hashindexes, not only btree and spgist indexes as before. That's not aterribly exciting result, but it does fix an omission mentioned inthe ancient comments here.Note: no catversion bump, even though this touches pg_operator.dat,because it's only adding OID macros not changing the contents ofpostgres.bki.Per consideration of a report from Manuel Rigger.Discussion:https://postgr.es/m/CA+u7OA7nnGYy8rY0vdTe811NuA+Frr9nbcBO9u2Z+JxqNaud+g@mail.gmail.com1 parent86be645 commit2ddedca
File tree
2 files changed
+108
-72
lines changed- src
- backend/utils/adt
- include/catalog
2 files changed
+108
-72
lines changedLines changed: 85 additions & 57 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
39 | 39 |
| |
40 | 40 |
| |
41 | 41 |
| |
| 42 | + | |
42 | 43 |
| |
43 | 44 |
| |
44 | 45 |
| |
| |||
240 | 241 |
| |
241 | 242 |
| |
242 | 243 |
| |
243 |
| - | |
| 244 | + | |
| 245 | + | |
| 246 | + | |
| 247 | + | |
244 | 248 |
| |
245 | 249 |
| |
246 | 250 |
| |
| |||
284 | 288 |
| |
285 | 289 |
| |
286 | 290 |
| |
287 |
| - | |
288 |
| - | |
289 |
| - | |
290 |
| - | |
291 |
| - | |
292 |
| - | |
293 |
| - | |
294 |
| - | |
295 |
| - | |
296 |
| - | |
297 |
| - | |
298 |
| - | |
299 |
| - | |
300 |
| - | |
301 |
| - | |
302 |
| - | |
303 |
| - | |
304 |
| - | |
305 |
| - | |
306 |
| - | |
| 291 | + | |
| 292 | + | |
| 293 | + | |
| 294 | + | |
| 295 | + | |
| 296 | + | |
| 297 | + | |
307 | 298 |
| |
308 |
| - | |
| 299 | + | |
| 300 | + | |
309 | 301 |
| |
310 |
| - | |
311 |
| - | |
312 |
| - | |
313 |
| - | |
| 302 | + | |
| 303 | + | |
| 304 | + | |
| 305 | + | |
| 306 | + | |
| 307 | + | |
| 308 | + | |
| 309 | + | |
| 310 | + | |
| 311 | + | |
| 312 | + | |
| 313 | + | |
| 314 | + | |
| 315 | + | |
| 316 | + | |
| 317 | + | |
314 | 318 |
| |
315 | 319 |
| |
| 320 | + | |
316 | 321 |
| |
317 |
| - | |
318 |
| - | |
| 322 | + | |
| 323 | + | |
| 324 | + | |
| 325 | + | |
| 326 | + | |
| 327 | + | |
| 328 | + | |
| 329 | + | |
319 | 330 |
| |
320 | 331 |
| |
321 |
| - | |
322 |
| - | |
323 |
| - | |
324 |
| - | |
325 |
| - | |
326 |
| - | |
327 |
| - | |
328 |
| - | |
329 |
| - | |
| 332 | + | |
| 333 | + | |
| 334 | + | |
| 335 | + | |
| 336 | + | |
| 337 | + | |
| 338 | + | |
| 339 | + | |
| 340 | + | |
| 341 | + | |
| 342 | + | |
| 343 | + | |
| 344 | + | |
| 345 | + | |
| 346 | + | |
330 | 347 |
| |
331 | 348 |
| |
332 |
| - | |
333 |
| - | |
| 349 | + | |
| 350 | + | |
| 351 | + | |
| 352 | + | |
| 353 | + | |
334 | 354 |
| |
335 | 355 |
| |
336 |
| - | |
337 | 356 |
| |
| 357 | + | |
338 | 358 |
| |
339 | 359 |
| |
340 | 360 |
| |
341 |
| - | |
342 |
| - | |
| 361 | + | |
| 362 | + | |
| 363 | + | |
| 364 | + | |
| 365 | + | |
| 366 | + | |
| 367 | + | |
| 368 | + | |
| 369 | + | |
| 370 | + | |
| 371 | + | |
| 372 | + | |
| 373 | + | |
343 | 374 |
| |
344 | 375 |
| |
345 | 376 |
| |
| |||
358 | 389 |
| |
359 | 390 |
| |
360 | 391 |
| |
361 |
| - | |
362 |
| - | |
| 392 | + | |
| 393 | + | |
| 394 | + | |
| 395 | + | |
| 396 | + | |
363 | 397 |
| |
364 | 398 |
| |
365 | 399 |
| |
366 |
| - | |
367 |
| - | |
368 |
| - | |
| 400 | + | |
369 | 401 |
| |
370 |
| - | |
| 402 | + | |
371 | 403 |
| |
372 | 404 |
| |
373 | 405 |
| |
| |||
379 | 411 |
| |
380 | 412 |
| |
381 | 413 |
| |
382 |
| - | |
383 |
| - | |
384 |
| - | |
| 414 | + | |
385 | 415 |
| |
386 |
| - | |
| 416 | + | |
387 | 417 |
| |
388 | 418 |
| |
389 | 419 |
| |
| |||
396 | 426 |
| |
397 | 427 |
| |
398 | 428 |
| |
399 |
| - | |
400 |
| - | |
401 |
| - | |
| 429 | + | |
402 | 430 |
| |
403 |
| - | |
| 431 | + | |
404 | 432 |
| |
405 | 433 |
| |
406 | 434 |
| |
407 |
| - | |
| 435 | + | |
408 | 436 |
| |
409 | 437 |
| |
410 | 438 |
| |
|
Lines changed: 23 additions & 15 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
107 | 107 |
| |
108 | 108 |
| |
109 | 109 |
| |
110 |
| - | |
| 110 | + | |
111 | 111 |
| |
112 | 112 |
| |
113 | 113 |
| |
114 | 114 |
| |
115 |
| - | |
| 115 | + | |
116 | 116 |
| |
117 | 117 |
| |
118 | 118 |
| |
| |||
122 | 122 |
| |
123 | 123 |
| |
124 | 124 |
| |
125 |
| - | |
| 125 | + | |
| 126 | + | |
126 | 127 |
| |
127 | 128 |
| |
128 | 129 |
| |
| |||
789 | 790 |
| |
790 | 791 |
| |
791 | 792 |
| |
792 |
| - | |
| 793 | + | |
793 | 794 |
| |
794 | 795 |
| |
795 | 796 |
| |
| |||
801 | 802 |
| |
802 | 803 |
| |
803 | 804 |
| |
804 |
| - | |
| 805 | + | |
| 806 | + | |
805 | 807 |
| |
806 | 808 |
| |
807 | 809 |
| |
| |||
1160 | 1162 |
| |
1161 | 1163 |
| |
1162 | 1164 |
| |
1163 |
| - | |
| 1165 | + | |
1164 | 1166 |
| |
1165 | 1167 |
| |
1166 | 1168 |
| |
| |||
1180 | 1182 |
| |
1181 | 1183 |
| |
1182 | 1184 |
| |
1183 |
| - | |
| 1185 | + | |
1184 | 1186 |
| |
1185 | 1187 |
| |
1186 | 1188 |
| |
| |||
1195 | 1197 |
| |
1196 | 1198 |
| |
1197 | 1199 |
| |
1198 |
| - | |
| 1200 | + | |
| 1201 | + | |
1199 | 1202 |
| |
1200 | 1203 |
| |
1201 | 1204 |
| |
| |||
2330 | 2333 |
| |
2331 | 2334 |
| |
2332 | 2335 |
| |
2333 |
| - | |
| 2336 | + | |
2334 | 2337 |
| |
2335 | 2338 |
| |
2336 | 2339 |
| |
| |||
2339 | 2342 |
| |
2340 | 2343 |
| |
2341 | 2344 |
| |
2342 |
| - | |
| 2345 | + | |
2343 | 2346 |
| |
2344 | 2347 |
| |
2345 | 2348 |
| |
| |||
2354 | 2357 |
| |
2355 | 2358 |
| |
2356 | 2359 |
| |
2357 |
| - | |
| 2360 | + | |
| 2361 | + | |
2358 | 2362 |
| |
2359 | 2363 |
| |
2360 | 2364 |
| |
| |||
2416 | 2420 |
| |
2417 | 2421 |
| |
2418 | 2422 |
| |
2419 |
| - | |
| 2423 | + | |
| 2424 | + | |
2420 | 2425 |
| |
2421 | 2426 |
| |
2422 | 2427 |
| |
| |||
2426 | 2431 |
| |
2427 | 2432 |
| |
2428 | 2433 |
| |
2429 |
| - | |
| 2434 | + | |
| 2435 | + | |
2430 | 2436 |
| |
2431 | 2437 |
| |
2432 | 2438 |
| |
| |||
2437 | 2443 |
| |
2438 | 2444 |
| |
2439 | 2445 |
| |
2440 |
| - | |
| 2446 | + | |
| 2447 | + | |
2441 | 2448 |
| |
2442 | 2449 |
| |
2443 | 2450 |
| |
| |||
2447 | 2454 |
| |
2448 | 2455 |
| |
2449 | 2456 |
| |
2450 |
| - | |
| 2457 | + | |
| 2458 | + | |
2451 | 2459 |
| |
2452 | 2460 |
| |
2453 | 2461 |
| |
|
0 commit comments
Comments
(0)