KX Community

Find answers, ask questions, and connect with our KX Community around the world.
KX Community Guidelines

Home Forums kdb+ HDB – map sym to int for partitioning Re: HDB – map sym to int for partitioning

  • davidcrossey

    Member
    February 23, 2023 at 12:00 am

    Hi erichards,

    You could partition by int in this case – note, a sym is just a mapping to an integer value anyway, so you could use that for your partitioning. A blog from Aqua-Q here that discusses how this is applicable to IoT, and how you may manage the mapping as an example: kdb+ IoT Database Structure | AquaQ

    In terms of upper limit, I presume that would be the max integer value, but my best advice would be to mock up a database with some int partitions to see how performant it is and any limitations that come with it for your use-case.

    One consideration to keep in mind is that depending on your data read/write access patterns, some partitions could grow exponentially large, in which case you may want to add another layer of abstraction to your write down – e.g. int = year+sym for better query distribution later.

    Hope this helps.