Originally from the User Slack
@Artem_Golovko: Hello everyone. I would like to ask about batch performance consideration. Are there any performance improvements from grouping several INSERT statements with the same PK and same table together with UNLOGGED batch on the client side?
@dor: Probably, since it will go to the same replicas anyway. Write performance in general is very good, not sure you need to over think it
@Artem_Golovko: @dor if you will have the following structure
table1: ((key), f1, f2), value
table2: ((key), f2, f1), value
so absolutely the same tables, but first one allow you to get value based on the f1, while the second one allow you to get value based on the f2. And you need 2 inserts for every record.
My idea was to merge these two tables into the one table:
common_table: ((key), type, f1, f2), value
now I can use a batch insert:
BEGIN BATCH
INSERT key, false, f1, f2, value
INSERT key, true, f2, f1, value
END BATCH
Does it make sense?
@dor: Oh, two separate tables, that wouldn’t improve performance. Each table has its own set of sstables ,caches, etc