Search code examples
postgresqlindexingolapcitus

How to add index to CitusDB's cstore_fdw?


I'm currently building an OLAP database in postgres and want to compare the performance of a column-store vs row-store database. CitusDB open-sourced its columnar-store extension cstore_fdw so I'm comparing database performance with and without this extension.

The example shows how to make a test db and query it. I have that example running. But then I try to add indices to it to and get the error ERROR: cannot create index on foreign table "table_name". It makes sense that I can't add indices to a foreign table. Yet, I still need to index that table, or else there's no way it will do well slicing or drilling into the data. How do I do this?


Solution

  • cstore_fdw currently doesn't support PostgreSQL indexes. But it automatically stores some min/max statistics in skip indexes which makes execution of some queries much more efficient.

    To learn more about how to use skip indexes please consult documentation.