On Tue, Sep 17, 2019 at 4:24 PM Amit Kapila <amit.kapil...@gmail.com> wrote: > > On Sat, Sep 14, 2019 at 6:35 PM Fabien COELHO <coe...@cri.ensmp.fr> wrote: > > One more comment: > +typedef enum { PART_NONE, PART_RANGE, PART_HASH, PART_UNKNOWN } > + partition_method_t; > > See, if we can eliminate PART_UNKNOWN. I don't see much use of same. > It is used at one place where we can set PART_NONE without much loss. > Having lesser invalid values makes code easier to follow. >
Looking more closely at this case: + else if (PQntuples(res) != 1) + { + /* unsure because multiple (or no) pgbench_accounts found */ + partition_method = PART_UNKNOWN; + partitions = 0; + } Is it ever possible to have multiple pgbench_accounts considering we have unique index on (relname, relnamespace) for pg_class? -- With Regards, Amit Kapila. EnterpriseDB: http://www.enterprisedb.com