Skip to content

Commit 4b2382b

Browse files
committed
add more comments, remove completed tasks from README.md
1 parent c61cb62 commit 4b2382b

File tree

3 files changed

+14
-9
lines changed

3 files changed

+14
-9
lines changed

README.md

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,6 @@ More interesting features are yet to come. Stay tuned!
3838

3939
## Roadmap
4040

41-
* Provide a way to create user-defined partition creation\destruction callbacks (issue [#22](https://github.com/postgrespro/pg_pathman/issues/22))
4241
* Implement LIST partitioning scheme;
4342
* Optimize hash join (both tables are partitioned by join key).
4443

src/pathman.h

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -66,12 +66,12 @@
6666
*/
6767
#define PATHMAN_PARTITION_LIST "pathman_partition_list"
6868
#define Natts_pathman_partition_list 6
69-
#define Anum_pathman_pl_parent 1
70-
#define Anum_pathman_pl_partition 2
71-
#define Anum_pathman_pl_parttype 3
72-
#define Anum_pathman_pl_partattr 4
73-
#define Anum_pathman_pl_range_min 5
74-
#define Anum_pathman_pl_range_max 6
69+
#define Anum_pathman_pl_parent 1 /* partitioned relation (regclass) */
70+
#define Anum_pathman_pl_partition 2 /* child partition (regclass) */
71+
#define Anum_pathman_pl_parttype 3 /* partitioning type (1|2) */
72+
#define Anum_pathman_pl_partattr 4 /* partitioned column (text) */
73+
#define Anum_pathman_pl_range_min 5 /* partition's min value */
74+
#define Anum_pathman_pl_range_max 6 /* partition's max value */
7575

7676

7777
/*

src/pl_funcs.c

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -62,15 +62,18 @@ PG_FUNCTION_INFO_V1( invoke_on_partition_created_callback );
6262
PG_FUNCTION_INFO_V1( debug_capture );
6363

6464

65+
/*
66+
* User context for function show_partition_list_internal().
67+
*/
6568
typedef struct
6669
{
6770
Relation pathman_config;
6871
HeapScanDesc pathman_config_scan;
6972
Snapshot snapshot;
7073

71-
const PartRelationInfo *current_prel;
74+
const PartRelationInfo *current_prel; /* selected PartRelationInfo */
7275

73-
uint32 child_number;
76+
uint32 child_number; /* child we're looking at */
7477
} show_partition_list_cxt;
7578

7679

@@ -348,6 +351,7 @@ show_partition_list_internal(PG_FUNCTION_ARGS)
348351
/* Alias to 'usercxt->current_prel' */
349352
prel = usercxt->current_prel;
350353

354+
/* If we've run out of partitions, switch to the next 'prel' */
351355
if (usercxt->child_number >= PrelChildrenCount(prel))
352356
{
353357
usercxt->current_prel = NULL;
@@ -359,10 +363,12 @@ show_partition_list_internal(PG_FUNCTION_ARGS)
359363
partattr_cstr = get_attname(PrelParentRelid(prel), prel->attnum);
360364
if (!partattr_cstr)
361365
{
366+
/* Parent does not exist, go to the next 'prel' */
362367
usercxt->current_prel = NULL;
363368
continue;
364369
}
365370

371+
/* Fill in common values */
366372
values[Anum_pathman_pl_parent - 1] = PrelParentRelid(prel);
367373
values[Anum_pathman_pl_parttype - 1] = prel->parttype;
368374
values[Anum_pathman_pl_partattr - 1] = CStringGetTextDatum(partattr_cstr);

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy