How to Create Partitions

We recommend creating a dedicated partition in the aps_security_link table for a reseller to increase performance when executing big data amount queries. This makes sense for resellers who deal with amounts of 10,000 or more accounts, users, resources, service plans, and so on.

To create a partition, complete the following steps:

  1. Find a reseller ID by account name:

    SELECT id, service_id, properties ->> 'id', properties ->> 'companyName' FROM aps_resource WHERE service_id = 'rest/pa-account' AND properties ->> 'companyName' = 'L1 Reseller'; 
    id | service_id | ?column? | ?column?
    ----+-----------------+----------+--------------
    38 | rest/pa-account | 3 | L1 Reseller
    
  2. Stop the OSS service:

    kubectl scale oss-node --replicas=0
  3. Create a partition for the reseller:

    CREATE TABLE aps_security_link_38 (LIKE aps_security_link_default INCLUDING ALL);
    ALTER TABLE aps_security_link_38 OWNER TO oss;
    INSERT INTO aps_security_link_38 SELECT * FROM aps_security_link_default WHERE actor_id = 38;
    DELETE FROM aps_security_link_default WHERE actor_id = 38;
    ALTER TABLE aps_security_link ATTACH PARTITION aps_security_link_38 FOR VALUES IN (38);
    
  4. Start the OSS service:

    kubectl scale oss-node --replicas=1
CloudBlue, an Ingram Micro business, uses cookies to improve the usability of our site. By continuing to use this site and/or logging in you are accepting the use of these cookies. For more information, visit our Privacy Policy.