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

Optimisation by storing json in jsonb columns instead of text columns #12

Open
hylkevds opened this issue May 20, 2019 · 1 comment
Open
Labels
Performance Potential performance optimisation possible

Comments

@hylkevds
Copy link
Collaborator

Currently FROST stores all JSON content in text columns, meaning that to filter on it, PostgreSQL has to parse the text to json each time. This can be improved by using jsonb columns.

@hylkevds hylkevds added the Performance Potential performance optimisation possible label May 20, 2019
@hylkevds
Copy link
Collaborator Author

Interestingly, some queries are slower on JSONB columns than on text columns. It seems that this is because DISTINCT is slower on JSONB columns than on TEXT columns. If I take the JSONB column out of the result set of such a query, by doing a $select=name,id, then the result is a lot faster:

Flat Things; Top; Filter DSTime, 1DepId, ResultCode;                  3773
Flat Things; Top; Filter DSTime, 1DepId, ResultCode; Select name,id   1446

This makes sense, since comparing text is easy. Comparing json trees is a lot more involved.

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

No branches or pull requests

1 participant