zlacker

[parent] [thread] 12 comments
1. worthl+(OP)[view] [source] 2023-09-25 03:29:38
Queue can clearly mean "work that needs to be completed" not necessarily 'work completed in order'. Your definition is much stricter than it needs to be for most use cases.
replies(3): >>nsonha+go >>CyberD+TY >>worthl+9W4
2. nsonha+go[view] [source] 2023-09-25 08:29:13
>>worthl+(OP)
There is clearly a conceptual difference between a set of things from which you pull things out randomly, and a queue. A queue always has intrinsic criteria to select the next item to be pulled out.
replies(1): >>sarche+FM
◧◩
3. sarche+FM[view] [source] [discussion] 2023-09-25 12:07:24
>>nsonha+go
There are many times when the start order doesn’t really matter, and the additional sorting overhead isn’t worth it. In those cases people will still tend to refer to the entity holding the jobs to be processed as a queue despite the fact that it doesn’t strictly follow FIFO order.

If they are being technically precise, queue isn’t the correct term, but language changes with context and time. Either way the implementation isn’t wrong if strict start order has been considered and isn’t important.

replies(1): >>nsonha+Xz3
4. CyberD+TY[view] [source] 2023-09-25 13:09:41
>>worthl+(OP)
not necessarily 'work completed in order'

That's exactly what a queue means, not just in every day life, but specifically in computer science.

replies(1): >>MaxBar+yE2
◧◩
5. MaxBar+yE2[view] [source] [discussion] 2023-09-25 19:50:40
>>CyberD+TY
This depends if we consider a priority queue to be a type of queue.
replies(1): >>CyberD+4G2
◧◩◪
6. CyberD+4G2[view] [source] [discussion] 2023-09-25 19:57:50
>>MaxBar+yE2
No it doesn't. A queue always has an order. A priority queue just means you aren't always inserting at the last place in the queue.
◧◩◪
7. nsonha+Xz3[view] [source] [discussion] 2023-09-26 01:27:06
>>sarche+FM
you're confusing between "i don't care about order", and "there is no order". Name ONE queue implementation that doesn't have order.
replies(2): >>worthl+AU3 >>sarche+tR4
◧◩◪◨
8. worthl+AU3[view] [source] [discussion] 2023-09-26 04:37:33
>>nsonha+Xz3
Having and caring about are different things.

I care about money, I dont have money.

◧◩◪◨
9. sarche+tR4[view] [source] [discussion] 2023-09-26 12:10:45
>>nsonha+Xz3
Here 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-...

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.

replies(1): >>nsonha+nC7
10. worthl+9W4[view] [source] 2023-09-26 12:36:03
>>worthl+(OP)
From the dictionary.

Queue: a list of data items, commands, etc., stored so as to be retrievable in a definite order, usually the order of insertion.

note the term "Usually", not "always".

replies(1): >>nsonha+K08
◧◩◪◨⬒
11. nsonha+nC7[view] [source] [discussion] 2023-09-27 01:42:09
>>sarche+tR4
> 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?

replies(1): >>sarche+Roa
◧◩
12. nsonha+K08[view] [source] [discussion] 2023-09-27 04:36:09
>>worthl+9W4
> to be retrievable in a definite order, usually the order of insertion.

always has an oder, which is usually of insertion.

◧◩◪◨⬒⬓
13. sarche+Roa[view] [source] [discussion] 2023-09-27 18:49:16
>>nsonha+nC7
It 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.

[go to top]