4 ms·
you're confusing between "i don't care about order", and "there is no order". Name ONE queue implementation that doesn't have order.
by nsonha 3y ago
you're confusing between "i don't care about order", and "there is no order". Name ONE queue implementation that doesn't have order.
- worthless-trash 3y agoHaving and caring about are different things. I care about money, I dont have money.
- sarchertech 3y agoHere you go. One of the first tutorials explaining how SKIP LOCKED works in Postgres implants a job “queue” that doesn’t have an order by clause. https://www.pgcasts.com/episodes/the-skip-locked-feature-in-postgres-9-5 https://www.pgcasts.com/episodes/the-skip-locked-feature-in-... I’m not confusing anything. I’ve seen random selection “job queues” implemented many times. As long as you truly don’t care about start order, it’s fine to trade it for increased throughout.
- nsonha 3y ago> doesn’t have an “order by” clause Does that mean it doesn't have any order or that whoever writes the query doesn't care about order? Also we are arguing over whether pg suffices as a queue implementation, and you use itself as an example?
- sarchertech 3y agoIt means that you are telling pg that you don’t care about order, so it is free to optimize the query in whatever way it wants to. The order can change query to query depending on numerous external factors. I’m not using pg itself as an example. I’m using a specific implementation of a “job queue” built with pg. I’ve seen and you can search for and find many implementations of “job queues” using relational databases where job start order guarantees are traded away for throughput.