forked frompostgres/postgres
- Notifications
You must be signed in to change notification settings - Fork6
Commite5f1bb9
committed
Simplify index tuple descriptor initialization
We have two code paths for initializing the tuple descriptor for a newindex: For a normal index, we copy the tuple descriptor from the tableand reset a number of fields that are not applicable to indexes. For anexpression index, we make a blank tuple descriptor and fill in theneeded fields based on the provided expressions. As pg_attribute hasgrown over time, the number of fields that we need to reset in the firstcase is now bigger than the number of fields we actually want to copy,so it's sensible to do it the other way around: Make a blank descriptorand copy just the fields we need. This also allows more code sharingbetween the two branches, and it avoids having to touch this code foralmost every unrelated change to the pg_attribute structure.Reviewed-by: Arthur Zakirov <a.zakirov@postgrespro.ru>1 parent7046d30 commite5f1bb9
1 file changed
+23
-34
lines changedLines changed: 23 additions & 34 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
319 | 319 |
| |
320 | 320 |
| |
321 | 321 |
| |
322 |
| - | |
323 |
| - | |
324 |
| - | |
| 322 | + | |
325 | 323 |
| |
326 | 324 |
| |
327 | 325 |
| |
| |||
332 | 330 |
| |
333 | 331 |
| |
334 | 332 |
| |
| 333 | + | |
| 334 | + | |
| 335 | + | |
| 336 | + | |
| 337 | + | |
| 338 | + | |
| 339 | + | |
| 340 | + | |
| 341 | + | |
| 342 | + | |
| 343 | + | |
| 344 | + | |
| 345 | + | |
335 | 346 |
| |
336 | 347 |
| |
337 | 348 |
| |
| |||
356 | 367 |
| |
357 | 368 |
| |
358 | 369 |
| |
359 |
| - | |
360 |
| - | |
361 |
| - | |
362 |
| - | |
363 |
| - | |
364 |
| - | |
365 |
| - | |
366 |
| - | |
367 |
| - | |
368 |
| - | |
369 |
| - | |
370 |
| - | |
371 |
| - | |
372 |
| - | |
373 |
| - | |
374 |
| - | |
375 |
| - | |
376 |
| - | |
377 |
| - | |
378 |
| - | |
379 |
| - | |
380 |
| - | |
| 370 | + | |
| 371 | + | |
| 372 | + | |
| 373 | + | |
| 374 | + | |
| 375 | + | |
| 376 | + | |
| 377 | + | |
381 | 378 |
| |
382 | 379 |
| |
383 | 380 |
| |
384 | 381 |
| |
385 | 382 |
| |
386 | 383 |
| |
387 |
| - | |
388 |
| - | |
389 | 384 |
| |
390 | 385 |
| |
391 | 386 |
| |
| |||
401 | 396 |
| |
402 | 397 |
| |
403 | 398 |
| |
404 |
| - | |
| 399 | + | |
405 | 400 |
| |
406 |
| - | |
407 | 401 |
| |
408 | 402 |
| |
409 | 403 |
| |
410 | 404 |
| |
411 | 405 |
| |
412 |
| - | |
413 |
| - | |
414 | 406 |
| |
415 |
| - | |
416 |
| - | |
417 |
| - | |
418 | 407 |
| |
419 | 408 |
| |
420 | 409 |
| |
|
0 commit comments
Comments
(0)