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

Performance of category search with JDBC Adapter on Postgres #299

Open
tvsignal opened this issue Jun 13, 2017 · 1 comment
Open

Performance of category search with JDBC Adapter on Postgres #299

tvsignal opened this issue Jun 13, 2017 · 1 comment

Comments

@tvsignal
Copy link

Hi, and thanks for this nice feed provider :)

When we have around 25 million entries in the feed, with Atom Hopper 1.2.33 and categories stored in a Postgres array, a search for entries with a given category value is prohibitively slow. When we get a page of entries, we also get the link to an older page. Finding the marker entry id for that link is what slows down everything. We find that atom hopper uses the SQL below.

We have also seen that categories can be stored in a dedicated column when a prefix column map is used, such that posting with the category customer:12312 would put 12312 in the column customer_id. That seems to be working well. However, I wonder why that option isn't properly documented. Are there great downsides to it, or better options? We don't want to rewrite Atom Hopper's SQL...

(SELECT * FROM entries WHERE feed = 'comp/dummyfeed' AND datelastupdated = '2017-05-16 11:22:16.710796' AND categories @> '{cat432542}'::varchar[] AND id < 14729912)
UNION ALL
(SELECT * FROM entries WHERE feed = 'comp/dummyfeed' AND datelastupdated < '2017-05-16 11:22:16.710796' AND categories @> '{cat432542}'::varchar[]
ORDER BY datelastupdated DESC, id DESC limit 1)
ORDER BY datelastupdated DESC, id DESC limit 1

@tvsignal
Copy link
Author

tvsignal commented Aug 7, 2017

No comments? I'm gonna assume that "dedicated column" and "prefix column map" is a good solution, then...

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

No branches or pull requests

1 participant