RE: Tower: A REST API implementation on the top of Hivemind

You are viewing a single comment's thread from:

Tower: A REST API implementation on the top of Hivemind

in utopian-io •  6 years ago  (edited)

Yeah, unfortunately, if you try a wide ordering on posts or posts_cache it happens since it takes a good amount of time to get the results. Try limiting and narrowing the query for a better performance, for now.

What did you try?

Authors get paid when people like you upvote their post.
If you enjoyed what you read here, create your account today and start earning FREE STEEM!
Sort Order:  
  ·  6 years ago (edited)

Not with the api, yet :) I will add it if it returns in a feasible time to serve in the api.

@emrebeyler I added an index for it (took about 15 minutes) with

CREATE INDEX ON hive_posts_cache((json::json->>'app'));

and then I could query like this

SELECT json::json->>'app' as app, author, permlink, body, created_at from hive_posts_cache where json::json->>'app' like 'busy%' order by post_id desc limit 100

image.png

This is great @jrawsthorne!

How long does this example query take to complete after the index?

145ms
image.png

Fantastic. Thanks for the tip. I will try adding an additional index after the hive update/migration.

  ·  6 years ago (edited)

Muy buena información, aunque tuve que usar el traductor ;)