Index Supply pfp
Index Supply
@indexsupply
If you are querying WowTokenCreated on the Index Supply free plan, please reach out to me as I have a query suggestion for you. It will bring your cold query latency from a couple of seconds down to ~150ms. here is the faster query: https://tinyurl.com/wowtoken-with-addr
2 replies
3 recasts
21 reactions

Sam pfp
Sam
@sammdec.eth
What was the slow query? Interested in comparing
1 reply
1 recast
2 reactions

Index Supply pfp
Index Supply
@indexsupply
It's the same query without the address. If the underlying data is cached (in pg's shared buffers or the OS's page cache) (it is as of this cast) then there will be no difference. This particular query is on the slower side simply because of how many rows are being returned. I'm not saying that queries without addresses will always have a penalty, but in this particular case, adding the address predicate will increase cache hit rate because fewer file system pages are needed. And when it's not cached it will be quicker for the same reason.
1 reply
1 recast
3 reactions

Sam pfp
Sam
@sammdec.eth
Oh that’s good to know. I’m honestly surprised it would have worked at all without an address. I would have assumed the query space would be too vast tbh.
1 reply
0 recast
0 reaction

Index Supply pfp
Index Supply
@indexsupply
We've got plenty of indexes around these parts ;)
1 reply
0 recast
1 reaction

Sam pfp
Sam
@sammdec.eth
BRIN indexes I hope 😉
0 reply
0 recast
1 reaction