RE: Pg10 : Client Configuration for Parallelism ?

From: <laurent(dot)dechambe(at)orange(dot)com>
To: Justin Pryzby <pryzby(at)telsasoft(dot)com>
Cc: Andreas Joseph Krogh <andreas(at)visena(dot)com>, "pgsql-performance(at)lists(dot)postgresql(dot)org" <pgsql-performance(at)lists(dot)postgresql(dot)org>
Subject: RE: Pg10 : Client Configuration for Parallelism ?
Date: 2019-04-17 14:33:28
Message-ID: 28619_1555511609_5CB73939_28619_199_1_A971FB43DFBC3D4C859ACB3316C9FF4632D98FA3@OPEXCAUBM42.corporate.adroot.infra.ftgroup
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-performance

Hello Justin and thank you for your clues.

Finally I found that putting blank to the option that limits the number of rows to retrieve (which is normal for this kind of tool) allows PostgreSQL to parallelize the query.

On jdbc it seems this is equivalent to write :
statement. setMaxRows(0); // parallelism authorized, which is the default.

Thus on my jdbc basic program if I add :
statement. setMaxRows(100); // No parallelism allowed (at least in Pg10)

Thanks to all who were kind enough to help.

Laurent

-----Message d'origine-----
De : Justin Pryzby [mailto:pryzby(at)telsasoft(dot)com]
Envoyé : mercredi 17 avril 2019 15:57
À : DECHAMBE Laurent DTSI/DSI
Cc : Andreas Joseph Krogh; pgsql-performance(at)lists(dot)postgresql(dot)org
Objet : Re: Pg10 : Client Configuration for Parallelism ?

On Wed, Apr 17, 2019 at 09:51:02AM +0000, laurent(dot)dechambe(at)orange(dot)com wrote:
> <DBEAVER>
> 2019-04-17 11:30:42 CEST;35895;thedbuser;thedb;00000;LOG: 00000: execute <unnamed>: SELECT COUNT(1) FROM big_table
> 2019-04-17 11:30:42 CEST;35895;thedbuser;thedb;00000;LOCATION: exec_execute_message, postgres.c:1959

"execute" means it's using the extended protocol.
https://www.postgresql.org/docs/11/protocol-flow.html#PROTOCOL-FLOW-EXT-QUERY

> <BASIC JDBC>
> 2019-04-17 11:31:20 CEST;37257;thedbuser;thedb;00000;LOG: 00000: execute <unnamed>: SELECT COUNT(1) FROM big_table
> 2019-04-17 11:31:20 CEST;37257;thedbuser;thedb;00000;LOCATION: exec_execute_message, postgres.c:1959

Same.

> <PGADMIN4>
> 2019-04-17 11:32:56 CEST;37324;thedbuser;thedb;00000;LOG: 00000: statement: SELECT COUNT(1) FROM big_table;
> 2019-04-17 11:32:56 CEST;37324;thedbuser;thedb;00000;LOCATION: exec_simple_query, postgres.c:940

This is a "simple query", not using the "extended protocol".

On Wed, Apr 17, 2019 at 11:26:07AM +0000, laurent(dot)dechambe(at)orange(dot)com wrote:
> There is something in documentation that says that there won't be parallelism if " The client sends an Execute message with a non-zero fetch count."
> I am not sure what this sentence means.

This is likely the cause of the difference.

Could you run wireshark to watch the protocol traffic ?

I think it'll show that dbeaver is retrieving a portion of the result set.

Justin

_________________________________________________________________________________________________________________________

Ce message et ses pieces jointes peuvent contenir des informations confidentielles ou privilegiees et ne doivent donc
pas etre diffuses, exploites ou copies sans autorisation. Si vous avez recu ce message par erreur, veuillez le signaler
a l'expediteur et le detruire ainsi que les pieces jointes. Les messages electroniques etant susceptibles d'alteration,
Orange decline toute responsabilite si ce message a ete altere, deforme ou falsifie. Merci.

This message and its attachments may contain confidential or privileged information that may be protected by law;
they should not be distributed, used or copied without authorisation.
If you have received this email in error, please notify the sender and delete this message and its attachments.
As emails may be altered, Orange is not liable for messages that have been modified, changed or falsified.
Thank you.

In response to

Responses

Browse pgsql-performance by date

  From Date Subject
Next Message Laurenz Albe 2019-04-17 17:11:42 Re: Pg10 : Client Configuration for Parallelism ?
Previous Message Justin Pryzby 2019-04-17 13:57:18 Re: Pg10 : Client Configuration for Parallelism ?