Commit af8d3dd
committed
Fix AOCS sampling with large values (#353)
The gp_acquire_sample_rows function is called when the ANALYZE query is
executed. The error occurred when gp_acquire_sample_rows was called for AOCS
table with values which was more than block size and gp_use_fastanalyze was
enabled. The error manifested itself in the datumstreamread_nth function,
because largeObjectState was DatumStreamLargeObjectState_HaveAoContent.
The fast ANALYZE for AO tables implementation was got from Cloudberry (see
23aef441a827a77f3338e81950a0e66a26f6eaf7). Cloudberry calls aocs_gettuple first
time when a data block has not been read yet, because the required tuple may not
be in the first block. Cloudberry skips reading the block in
open_all_datumstreamread_segfiles when the SO_TYPE_ANALYZE flag is set
(when AOCSScanDesc is created in aoco_acquire_sample_rows). This skipping was
not backported to OpenGPDB later. The error is fixed with backporting of
the skipping.
The targrow field is used instead of flag to don't break ABI.
Pass AOCSScanDesc to open_all_datumstreamread_segfiles instead of fields of this
structure.1 parent 54d7cbe commit af8d3dd
4 files changed
Lines changed: 41 additions & 17 deletions
File tree
- src
- backend/access/aocs
- include/cdb
- test/regress
- expected
- sql
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
99 | 99 | | |
100 | 100 | | |
101 | 101 | | |
102 | | - | |
103 | | - | |
104 | | - | |
105 | | - | |
106 | | - | |
107 | | - | |
| 102 | + | |
108 | 103 | | |
| 104 | + | |
109 | 105 | | |
110 | 106 | | |
111 | 107 | | |
112 | | - | |
| 108 | + | |
113 | 109 | | |
114 | | - | |
| 110 | + | |
115 | 111 | | |
116 | | - | |
| 112 | + | |
| 113 | + | |
| 114 | + | |
| 115 | + | |
| 116 | + | |
| 117 | + | |
| 118 | + | |
117 | 119 | | |
118 | | - | |
119 | | - | |
| 120 | + | |
120 | 121 | | |
121 | 122 | | |
122 | 123 | | |
| |||
398 | 399 | | |
399 | 400 | | |
400 | 401 | | |
401 | | - | |
402 | | - | |
403 | | - | |
404 | | - | |
405 | | - | |
406 | | - | |
| 402 | + | |
407 | 403 | | |
408 | 404 | | |
409 | 405 | | |
| |||
550 | 546 | | |
551 | 547 | | |
552 | 548 | | |
| 549 | + | |
553 | 550 | | |
554 | 551 | | |
555 | 552 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
164 | 164 | | |
165 | 165 | | |
166 | 166 | | |
| 167 | + | |
167 | 168 | | |
168 | 169 | | |
169 | 170 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1016 | 1016 | | |
1017 | 1017 | | |
1018 | 1018 | | |
| 1019 | + | |
| 1020 | + | |
| 1021 | + | |
| 1022 | + | |
| 1023 | + | |
| 1024 | + | |
| 1025 | + | |
| 1026 | + | |
| 1027 | + | |
| 1028 | + | |
| 1029 | + | |
| 1030 | + | |
| 1031 | + | |
| 1032 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
506 | 506 | | |
507 | 507 | | |
508 | 508 | | |
| 509 | + | |
| 510 | + | |
| 511 | + | |
| 512 | + | |
| 513 | + | |
| 514 | + | |
| 515 | + | |
| 516 | + | |
| 517 | + | |
| 518 | + | |
| 519 | + | |
| 520 | + | |
0 commit comments