PostgreSQL Source Code: src/backend/executor/nodeBitmapHeapscan.c Source File (original) (raw)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
37
38#include <math.h>
39
50
55
56
57
58
59
60
61
62static void
64{
68
69 if (!pstate)
70 {
72
74 elog(ERROR, "unrecognized result from subplan");
75 }
77 {
78
79
80
81
84 elog(ERROR, "unrecognized result from subplan");
85
86
87
88
89
90
92
93
95 }
96
98 pstate ?
101
102
103
104
105
107 {
111 0,
112 NULL);
113 }
114
117}
118
119
120
121
122
123
124
127{
130
131
132
133
134
137
142 {
143
144
145
147
148
149
150
151
153 {
156 {
157
160 continue;
161 }
162 }
163
164
165 return slot;
166 }
167
168
169
170
172}
173
174
175
176
177
178
179
180static inline void
182{
187}
188
189
190
191
192static bool
194{
196
197
198
199
201
202
205}
206
207
208
209
210
213{
215
219}
220
221
222
223
224
225void
227{
229
231
232 if (scan)
233 {
234
235
236
237
240
241
243 }
244
245
246 if (node->tbm)
248 node->tbm = NULL;
251
253
254
255
256
257
260}
261
262
263
264
265
266void
268{
270
271
272
273
274
275
277 {
279
280 Assert(ParallelWorkerNumber <= node->sinstrument->num_workers);
282
283
284
285
286
287
288
289
292 }
293
294
295
296
298
299
300
301
303
304 if (scanDesc)
305 {
306
307
308
309
312
313
314
315
317 }
318
319
320
321
322 if (node->tbm)
324}
325
326
327
328
329
330
331
334{
337
338
340
341
342
343
344
346
347
348
349
354
355 scanstate->tbm = NULL;
356
357
359
361 scanstate->pstate = NULL;
362 scanstate->recheck = true;
363
364
365
366
367
368
370
371
372
373
375
376
377
378
380
381
382
383
387
388
389
390
393
394
395
396
401
403
404
405
406
407 return scanstate;
408}
409
410
411
412
413
414
415
416
417
418
419static bool
421{
423
424 while (1)
425 {
431
432
434 break;
435
436
438 }
439
441
443}
444
445
446
447
448
449
450
451
452void
455{
457
459
460
462 {
465 }
466
469}
470
471
472
473
474
475
476
477void
480{
484 char *ptr;
486
487
488 if (dsa == NULL)
489 return;
490
493 {
496 }
497
503
505
506
509
511
512 if (sinstrument)
513 {
515
516
519 }
520
522 node->pstate = pstate;
524}
525
526
527
528
529
530
531
532void
535{
538
539
540 if (dsa == NULL)
541 return;
542
544
547
549}
550
551
552
553
554
555
556
557void
560{
561 char *ptr;
562
564
566
569
572}
573
574
575
576
577
578
579
580void
582{
585
586 if (sinstrument == NULL)
587 return;
588
591
593 memcpy(node->sinstrument, sinstrument, size);
594}
bool ConditionVariableCancelSleep(void)
void ConditionVariableBroadcast(ConditionVariable *cv)
void ConditionVariableInit(ConditionVariable *cv)
void ConditionVariableSleep(ConditionVariable *cv, uint32 wait_event_info)
#define InvalidDsaPointer
#define DsaPointerIsValid(x)
void ExecReScan(PlanState *node)
ExprState * ExecInitQual(List *qual, PlanState *parent)
Node * MultiExecProcNode(PlanState *node)
void ExecEndNode(PlanState *node)
PlanState * ExecInitNode(Plan *node, EState *estate, int eflags)
TupleTableSlot * ExecScan(ScanState *node, ExecScanAccessMtd accessMtd, ExecScanRecheckMtd recheckMtd)
void ExecAssignScanProjectionInfo(ScanState *node)
void ExecScanReScan(ScanState *node)
void ExecInitScanTupleSlot(EState *estate, ScanState *scanstate, TupleDesc tupledesc, const TupleTableSlotOps *tts_ops)
void ExecInitResultTypeTL(PlanState *planstate)
void ExecAssignExprContext(EState *estate, PlanState *planstate)
Relation ExecOpenScanRelation(EState *estate, Index scanrelid, int eflags)
#define outerPlanState(node)
#define InstrCountFiltered2(node, delta)
struct BitmapHeapScanInstrumentation BitmapHeapScanInstrumentation
#define EXEC_FLAG_BACKWARD
bool(* ExecScanRecheckMtd)(ScanState *node, TupleTableSlot *slot)
static bool ExecQualAndReset(ExprState *state, ExprContext *econtext)
TupleTableSlot *(* ExecScanAccessMtd)(ScanState *node)
Assert(PointerIsAligned(start, uint64))
#define IsParallelWorker()
#define CHECK_FOR_INTERRUPTS()
void ExecEndBitmapHeapScan(BitmapHeapScanState *node)
void ExecBitmapHeapInitializeWorker(BitmapHeapScanState *node, ParallelWorkerContext *pwcxt)
void ExecReScanBitmapHeapScan(BitmapHeapScanState *node)
void ExecBitmapHeapEstimate(BitmapHeapScanState *node, ParallelContext *pcxt)
void ExecBitmapHeapRetrieveInstrumentation(BitmapHeapScanState *node)
void ExecBitmapHeapInitializeDSM(BitmapHeapScanState *node, ParallelContext *pcxt)
static bool BitmapShouldInitializeSharedState(ParallelBitmapHeapState *pstate)
void ExecBitmapHeapReInitializeDSM(BitmapHeapScanState *node, ParallelContext *pcxt)
static TupleTableSlot * ExecBitmapHeapScan(PlanState *pstate)
BitmapHeapScanState * ExecInitBitmapHeapScan(BitmapHeapScan *node, EState *estate, int eflags)
static TupleTableSlot * BitmapHeapNext(BitmapHeapScanState *node)
static void BitmapTableScanSetup(BitmapHeapScanState *node)
static void BitmapDoneInitializingSharedState(ParallelBitmapHeapState *pstate)
static bool BitmapHeapRecheck(BitmapHeapScanState *node, TupleTableSlot *slot)
#define IsA(nodeptr, _type_)
#define castNode(_type_, nodeptr)
#define RelationGetDescr(relation)
void * shm_toc_allocate(shm_toc *toc, Size nbytes)
void shm_toc_insert(shm_toc *toc, uint64 key, void *address)
void * shm_toc_lookup(shm_toc *toc, uint64 key, bool noError)
#define shm_toc_estimate_chunk(e, sz)
#define shm_toc_estimate_keys(e, cnt)
Size add_size(Size s1, Size s2)
Size mul_size(Size s1, Size s2)
#define IsMVCCSnapshot(snapshot)
#define SpinLockInit(lock)
#define SpinLockRelease(lock)
#define SpinLockAcquire(lock)
ParallelBitmapHeapState * pstate
ExprState * bitmapqualorig
BitmapHeapScanInstrumentation stats
SharedBitmapHeapInstrumentation * sinstrument
struct dsa_area * es_query_dsa
TupleTableSlot * ecxt_scantuple
shm_toc_estimator estimator
Instrumentation * instrument
ExprContext * ps_ExprContext
ExecProcNodeMtd ExecProcNode
Relation ss_currentRelation
TupleTableSlot * ss_ScanTupleSlot
struct TableScanDescData * ss_currentScanDesc
TBMIterator rs_tbmiterator
union TableScanDescData::@49 st
const TupleTableSlotOps * table_slot_callbacks(Relation relation)
static void table_endscan(TableScanDesc scan)
static TableScanDesc table_beginscan_bm(Relation rel, Snapshot snapshot, int nkeys, struct ScanKeyData *key)
static bool table_scan_bitmap_next_tuple(TableScanDesc scan, TupleTableSlot *slot, bool *recheck, uint64 *lossy_pages, uint64 *exact_pages)
static void table_rescan(TableScanDesc scan, struct ScanKeyData *key)
void tbm_free(TIDBitmap *tbm)
void tbm_end_iterate(TBMIterator *iterator)
dsa_pointer tbm_prepare_shared_iterate(TIDBitmap *tbm)
void tbm_free_shared_area(dsa_area *dsa, dsa_pointer dp)
TBMIterator tbm_begin_iterate(TIDBitmap *tbm, dsa_area *dsa, dsa_pointer dsp)
static bool tbm_exhausted(TBMIterator *iterator)
static TupleTableSlot * ExecClearTuple(TupleTableSlot *slot)