jacek-lewandowski commented on code in PR #2807:
URL: https://github.com/apache/cassandra/pull/2807#discussion_r1362516597


##########
src/java/org/apache/cassandra/db/SystemKeyspace.java:
##########
@@ -459,6 +468,45 @@ private SystemKeyspace()
           + "cfids set<uuid>, "
           + "PRIMARY KEY (parent_id))").build();
 
+    public static final TableMetadata LocalMetadataLog =

Review Comment:
   I'm not sure if I understand that correctly - there are four additional 
tables, but it looks like we need only one:
   - we need to be able to store a transformation per period and epoch
   - we need to store a snapshot per period
   - we need to be able to go through transformations sorted by epochs
   - we need to be able to find the latest period and the latest epoch
   
   Given we only have LocalMetadataLog, which stores the ultimate cluster 
metadata snapshot in a static column, we can probably get rid of the snapshots 
table;
   
   Old entries from the log should be evicted, so there should be little 
partitions representing periods. If so, we could fetch all period - min/max 
epoch tuples by performing a full table scan and memoizing the results. That 
would eliminate the need for the remaining two tables with sealed periods and 
the last sealed period. 
   
   Even if the table turns out to be big, making full scan too costly, we can 
leverage that each sstable contains min/max clustering information in the 
statistics metadata. By duplicating the period column as the first clustering 
column, we could quickly select the relevant sstables by only inspecting their 
metadata?
   
   Even if we need to store the last epoch and period, we could put them into 
`local` 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: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to