On 26 July 2017 at 02:37, Robert Haas <robertmh...@gmail.com> wrote: > Is there any real benefit in this "walker" interface? It looks to me > like it might be simpler to just change things around so that it > returns a list of OIDs, like find_all_inheritors, but generated > differently. Then if you want bound-ordering rather than > OID-ordering, you just do this: > > list_free(inhOids); > inhOids = get_partition_oids_in_bound_order(rel); > > That'd remove the need for some if/then logic as you've currently got > in get_next_child().
Yes, I had considered that ; i.e., first generating just a list of bound-ordered oids. But that consequently needs all the child tables to be opened and closed twice; once during the list generation, and then while expanding the partitioned table. Agreed, that the second time, heap_open() would not be that expensive because tables would be cached, but still it would require to get the cached relation handle from hash table. Since we anyway want to open the tables, better have a *next() function to go-get the next partition in a fixed order. Actually, there isn't much that the walker next() function does. Any code that wants to traverse bound-wise can do that by its own. The walker function is just a convenient way to make sure everyone traverses in the same order by using this function. Yet to go over other things including your review comments, and Amit Langote's patch on refactoring RelationGetPartitionDispatchInfo(). > On another note, did you do anything about the suggestion Thomas made > in > http://postgr.es/m/CAEepm=3sc_j1zwqdyrbu4dtfx5rhcamnnuaxrkwzfgt9m23...@mail.gmail.com > ? This is still pending on me; plus I think there are some more points. I need to go over those and consolidate a list of todos. -- Thanks, -Amit Khandekar EnterpriseDB Corporation The Postgres Database Company -- Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-hackers