WendelLana commented on issue #1004:
URL: https://github.com/apache/age/issues/1004#issuecomment-1693340237

   Aside from indices and ordering, as Zainab mentioned, we could use range 
partitioning as a way to optimize perfomance for our edge table. However, the 
[documentation](https://www.postgresql.org/docs/current/ddl-partitioning.html) 
says: 
   
   > a partition cannot have any parents other than the partitioned table it is 
a partition of, nor can a table inherit from both a partitioned table and a 
regular table. That means partitioned tables and their partitions never share 
an inheritance hierarchy with regular tables.
   
   So I believe we cannot use declarative partitioning because our `edge labels 
tables` is a child table of `_ag_label_edge`. However, we could partition only 
the `ag_label_edge` or implement partitioning using table inheritance (refer to 
documentation section 
[5.11.3.](https://www.postgresql.org/docs/current/ddl-partitioning.html#DDL-PARTITIONING-USING-INHERITANCE)).
 For example, the edge label `KNOWS` can be partitioned:
   
   ```
   CREATE TABLE graph_name.KNOWS_1 (
       CHECK (start_id >= 1 AND start_id < 1000 )
   ) INHERITS (graph_name."KNOWS");
   ```
   And then we need to create a `TRIGGER` `BEFORE INSERT` so that our 
application can redirect the data into the appropriate child table.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: dev-unsubscr...@age.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org

Reply via email to