Expand all | Collapse all

Table shard and drop a Partition

  • 1.  Table shard and drop a Partition

    Posted 08-19-2019 08:48
    Dear all,

    We can create a Shard Table as following

    CREATE TABLE customers(
    accountId text,
    name text,
    SHARD KEY (accountId))
    WITH (shard_count = 4);

    Sharding is allowed on the following column type
    • DATE
    • INT
    • TIME

    Question: Please let us know if we shard a Table with Date Field (dd-mmm-yy). Please let us know is it anyway possible to drop a Partition based on Date
    Example: 01-Jan-19 Record Count 10 Million, 02-Jan-19 Record Count 12 Million. Drop 01-Jan-19 Partition.


  • 2.  RE: Table shard and drop a Partition

    Posted 08-20-2019 00:56
    Hi @Sumit Srivastava,

    The shard table option is something like a hash partitioning and is intended to distribute the records between those partition on an even manner.
    Because of that, you can't determine if a particular date is on a shard or in another, so there isn't a function to drop a shard right now, and you have to rely on delete function, that's quite fast or a /itas to build a new table without the records not needed.