I'm running Postgres 12. I have an explain plan like this:
Sort (cost=87.71..88.75 rows=418 width=40)
Sort Key: language.name DESC
-> Hash Join (cost=1.14..69.51 rows=418 width=40)
Hash Cond: (film.language_id = language.language_id)
-> Seq Scan on film (cost=0.00..66.50 rows=418 width=21)
Filter: (rating = ANY ('{R,PG-13}'::mpaa_rating[]))
-> Hash (cost=1.06..1.06 rows=6 width=25)
-> Seq Scan on language (cost=0.00..1.06 rows=6 width=25)
As I understand, the nodes that have the startup cost equals to 0 will be the nodes that gets run first, so these 2 nodes runs in parallel:
Seq Scan on film (cost=0.00..66.50 rows=418 width=21)
Seq Scan on language (cost=0.00..1.06 rows=6 width=25)
Then this node gets run: Hash (cost=1.06..1.06 rows=6 width=25).
Then this node: Hash Join (cost=1.14..69.51 rows=418 width=40)
And finally: Sort (cost=87.71..88.75 rows=418 width=40)
However, according to this post: https://thoughtbot.com/blog/reading-an-explain-analyze-query-plan the execution order should be:
Seq Scan on language (cost=0.00..1.06 rows=6 width=25)
Hash (cost=1.06..1.06 rows=6 width=25)
Seq Scan on film (cost=0.00..66.50 rows=418 width=21)
Hash Join (cost=1.14..69.51 rows=418 width=40)
Sort (cost=87.71..88.75 rows=418 width=40)
So which is the correct answer ? Do I misunderstand the execution order ?