3 ms·
> What would be nice is a way to mandate that queries must go through certain indices. Yes, this is an interesting idea. We're kinda gravitating towards this a
by steve-chavez 5y ago
> What would be nice is a way to mandate that queries must go through certain indices.
Yes, this is an interesting idea. We're kinda gravitating towards this approach in PostgREST lately. For example, on a recent discussion about integrating with PGroonga[1], we were thinking of only exposing its operators once an index is enabled on a column:
CREATE INDEX index_name ON table USING pgroonga (column);
Enables doing:
GET /table?column=groonga_query.PostgreSQL
Which roughly translates to:
SELECT * FROM table WHERE column &@~ 'PostgreSQL';
Of course this is PostgREST-specific, only when going through it you'd enforce this restriction.
[1]: https://github.com/PostgREST/postgrest/issues/2028 https://github.com/PostgREST/postgrest/issues/2028