On 04/17/2018 07:17 AM, Pavel Stehule wrote:
Hi
2018-04-16 22:42 GMT+02:00 Hackety Man <hacketyman@xxxxxxxxx
<mailto:hacketyman@xxxxxxxxx>>:
...
>
A support of parallel query execution is not complete - it doesn't work
in PostgreSQL 11 too. So although EXISTS variant can be faster (but can
be - the worst case of EXISTS is same like COUNT), then due disabled
parallel execution the COUNT(*) is faster now. It is unfortunate,
because I believe so this issue will be fixed in few years.
None of the issues seems to be particularly related to parallel query.
It's much more likely a general issue with planning EXISTS / LIMIT and
non-uniform data distribution.
regards
--
Tomas Vondra http://www.2ndQuadrant.com
PostgreSQL Development, 24x7 Support, Remote DBA, Training & Services