Tomas, thank you. This machine is abare metal server running only a staging postgresql 10.3 instance. Nobody is using it beside me.
I'm attaching 4 files.
every_30_seconds_top_stats_during_query.txt - this is a caputure of the top command every 30 seconds(more or less) for 10+ minutes while I'm running the query. Let me know if this helps to answere your question.
EXPLAIN_WITH_LIMIT_AND_max_parallel_workers_per_gather_SET_TO_0.txt - query plan with full query and max_parallel_workers_per_gather force to 0. Full output.
EXPLAIN_WITH_LIMIT_AND_DEFAULT_PARALLEL_PROCESSING_SETTINGS.txt - query plan with full query and default parellel processing settings. Full output.
EXPLAIN_WITHOUT_LIMIT_AND_DEFAULT_PARALLEL_PROCESSING_SETTINGS.tx - query plan of the query omitting the LIMIT clause and default parellel processing settings. Full output.
For what concerns the self-contained test case - I'll do my best to prepare it.
Thank you very much, please let me know if this answer your questions.