Skip to content

Will there be a potential performance issue with the default partition table constraint #567

@anderssjoblom-vertex

Description

@anderssjoblom-vertex

I notice that the default partition has the constraints build from the constraint from the actual partitioned tables with a NOT and OR clause. If the partitions grows into the 100s of intervals, seems like this might be a performance issue with this constraint as show below instead of building one that will cover the sequence not partitioned:

Partition constraint: ((cust_id IS NOT NULL) AND (cust_id < 0 OR cust_id >= 59))

This is how the default partition constraint is built:

Partition constraint: (NOT ((cust_id IS NOT NULL) AND (((cust_id >= 0) AND (cust_id < 1)) OR ((cust_id >= 1) AND (cust_id < 2)) OR ((cust_id >= 2) AND (cust_id < 3)) OR ((cust_id >= 3) AND (cust_id < 4)) OR ((cust_id >= 4) AND (cust_id < 5)) OR ((cust_id >= 5) AND (cust_id < 6)) OR ((cust_id >= 6) AND (cust_id < 7)) OR ((cust_id >= 7) AND (cust_id < 8)) OR ((cust_id >= 8) AND (cust_id < 9)) OR ((cust_id >= 9) AND (cust_id < 10)) OR ((cust_id >= 10) AND (cust_id < 11)) OR ((cust_id >= 11) AND (cust_id < 12)) OR ((cust_id >= 12) AND (cust_id < 13)) OR ((cust_id >= 13) AND (cust_id < 14)) OR ((cust_id >= 14) AND (cust_id < 15)) OR ((cust_id >= 15) AND (cust_id < 16)) OR ((cust_id >= 16) AND (cust_id < 17)) OR ((cust_id >= 17) AND (cust_id < 18)) OR ((cust_id >= 18) AND (cust_id < 19)) OR ((cust_id >= 19) AND (cust_id < 20)) OR ((cust_id >= 20) AND (cust_id < 21)) OR ((cust_id >= 21) AND (cust_id < 22)) OR ((cust_id >= 22) AND (cust_id < 23)) OR ((cust_id >= 23) AND (cust_id < 24)) OR ((cust_id >= 24) AND (cust_id < 25)) OR ((cust_id >= 25) AND (cust_id < 26)) OR ((cust_id >= 26) AND (cust_id < 27)) OR ((cust_id >= 27) AND (cust_id < 28)) OR ((cust_id >= 28) AND (cust_id < 29)) OR ((cust_id >= 29) AND (cust_id < 30)) OR ((cust_id >= 30) AND (cust_id < 31)) OR ((cust_id >= 31) AND (cust_id < 32)) OR ((cust_id >= 32) AND (cust_id < 33)) OR ((cust_id >= 33) AND (cust_id < 34)) OR ((cust_id >= 34) AND (cust_id < 35)) OR ((cust_id >= 35) AND (cust_id < 36)) OR ((cust_id >= 36) AND (cust_id < 37)) OR ((cust_id >= 37) AND (cust_id < 38)) OR ((cust_id >= 38) AND (cust_id < 39)) OR ((cust_id >= 39) AND (cust_id < 40)) OR ((cust_id >= 40) AND (cust_id < 41)) OR ((cust_id >= 41) AND (cust_id < 42)) OR ((cust_id >= 42) AND (cust_id < 43)) OR ((cust_id >= 43) AND (cust_id < 44)) OR ((cust_id >= 44) AND (cust_id < 45)) OR ((cust_id >= 45) AND (cust_id < 46)) OR ((cust_id >= 46) AND (cust_id < 47)) OR ((cust_id >= 47) AND (cust_id < 48)) OR ((cust_id >= 48) AND (cust_id < 49)) OR ((cust_id >= 49) AND (cust_id < 50)) OR ((cust_id >= 50) AND (cust_id < 51)) OR ((cust_id >= 51) AND (cust_id < 52)) OR ((cust_id >= 52) AND (cust_id < 53)) OR ((cust_id >= 53) AND (cust_id < 54)) OR ((cust_id >= 54) AND (cust_id < 55)) OR ((cust_id >= 55) AND (cust_id < 56)) OR ((cust_id >= 56) AND (cust_id < 57)) OR ((cust_id >= 57) AND (cust_id < 58)) OR ((cust_id >= 58) AND (cust_id < 59)))))

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions