CapsicoHealth / Tilda

Apache License 2.0
13 stars 6 forks source link

Add clustering flag to indices #630

Open ldhasson opened 3 years ago

ldhasson commented 3 years ago

Some users have tables that they want to cluster. Right now, that's a separate manual process via extension sql files. It would be nice, and migration friendly, to incorporate the semantics explicitly with "clustering":true on indices.

Of course, only one index can be marked as clustered. Unsure though if clustering works only on unique indices or any index. Check with other databases such as SQLServer.

ldhasson commented 1 year ago

Clustering is not a simple thing as some databases define it as the index level (SQLServer) whereas others define it at the table level (postgres).

In my brain, it makes more sense to define it at the index level, so we'll add a "cluster:true|false" attribute to index definition.

Notes:

Overall, this may be just a bit more involved to implement fully.

ldhasson commented 1 year ago

Actually, there is a way to detect if an index is a clustering index with index-level meta-data as part of the JDBC standard with type=3 :)