Re: Do parallel queries work with only dblink not with fdw?

From: Stefan Keller <sfkeller(at)gmail(dot)com>
To: Marc Mamin <M(dot)Mamin(at)intershop(dot)de>
Cc: "Klaus P(dot)" <kpi6288(at)gmail(dot)com>, "pgsql-general(at)postgresql(dot)org" <pgsql-general(at)postgresql(dot)org>
Subject: Re: Do parallel queries work with only dblink not with fdw?
Date: 2016-09-08 11:31:29
Message-ID: CAFcOn28gVQPcpXqO1fwKbP_rWjXZo+Af8iKh56iCX-i1RcR2BA@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

Hi,

Sorry for appending to that thread, but I think this is related:
Does anyone have experience with parsel [1] and/or it's extension
parallelsql [2]?

:Stefan

[1] http://geeohspatial.blogspot.ch/2013/12/a-simple-function-for-parallel-queries_18.html
[2] https://github.com/k1aus/parallelsql

2016-05-04 16:10 GMT+02:00 Marc Mamin <M(dot)Mamin(at)intershop(dot)de>:
>>From: pgsql-general-owner(at)postgresql(dot)org [mailto:pgsql-general-owner(at)postgresql(dot)org] On Behalf Of Klaus P.
>>Sent: Mittwoch, 4. Mai 2016 10:28
>>To: pgsql-general(at)postgresql(dot)org
>>Subject: [GENERAL] Do parallel queries work with only dblink not with fdw?
>>
>>In order to improve cpu and disk utilization, I am testing parallel queries.
>>
>>The approach with dblink_send_query() and dblink_get_result() works in my proof-of-concept. Runtime of my reference query was reduced from 55 seconds to ~20seconds using 4 parallel connections. Not what I had hoped but certainly a significant improvement.
>>My approach is fairly easy:
>>db_link_send_query('conn1', 'statement based on partitioning field');
>>db_link_send_query('conn2', 'statement based on partitioning field');
>>
>>...
>>SELECT
>>dblink_get_result('conn1')
>>UNION ALL
>>dblink_get_result('conn2')
>>
>>...
>
>
> Hello,
>
> I'm using the db_link approach too, but rather than using dblink_get_result, I store the result in an additional table.
> This was faster, at least for my use case and at the time when I implemented that solution...
>
> something like
>
> db_link_send_query('conn0', 'CREATE UNLOGGED TABLE my_result...
> db_link_send_query('conn1', 'INSERT INTO my_result statement based on partitioning field');
> db_link_send_query('conn2', 'INSERT INTO my_result statement based on partitioning field');
> ...
> select * from my_result
>
> regards,
>
> Marc Mamin
>
> --
> Sent via pgsql-general mailing list (pgsql-general(at)postgresql(dot)org)
> To make changes to your subscription:
> http://www.postgresql.org/mailpref/pgsql-general

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Martijn Tonies (Upscene Productions) 2016-09-08 11:51:49 Re: IDE for function/stored proc development.
Previous Message Moreno Andreo 2016-09-08 11:30:33 Question about locking and pg_locks