Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add dynamic adaptation properties prototype #187

Draft
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

tomalrussell
Copy link
Member

Just creating this as a WIP pull request so we can discuss here.

@tomalrussell
Copy link
Member Author

I had a quick look at options for indexing JSONB, and it looks like we could index on an expression [1], and a hash index might be a relatively small and fast option if we always wanted a simple equality check:

CREATE INDEX ON test USING HASH ((data ->> 'field'));

EXPLAIN SELECT * FROM test WHERE data->>'field' = 'value';

As well as the more flexible GIN approach [2], which is the main thing discussed in the docs and articles I found, e.g. [3].

  1. https://www.postgresql.org/docs/current/indexes-expressional.html
  2. https://www.postgresql.org/docs/current/datatype-json.html#JSON-INDEXING
  3. https://pganalyze.com/blog/gin-index

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants