Apologies, I should have been clearer. I would like to execute a single
query on multiple cores - e.g. using the Parallel gem, as per the example
link I posted. I am just after confirmation this will work with Sequel a
code example of such a query and pointers on how I may need to configure my
database (e.g. the docs
<https://www.postgresql.org/docs/9.6/static/when-can-parallel-query-be-used.html>
say I need to set *max_parallel_workers_per_gather* to a non-zero value)
Here is the query, which identifies orphaned records (out of several
hundred thousand). This presently maxes out one core for several minutes &
I'd therefore like to use all 4 cores I have available.
puzzle_images = DB[:puzzles_images].select_map(:image_hash)
orphans = DB[:images].where('imhash NOT in ?', puzzle_images).all
Thanks
On Friday, 7 July 2017 22:28:05 UTC+1, Jeremy Evans wrote:
>
> On Friday, July 7, 2017 at 1:46:07 PM UTC-7, Bruce Steedman wrote:
>>
>> Has anyone tried this in Sequel & if so can you post a link to demo code?
>>
>> I've seen this example
>> <https://github.com/jeremyevans/sequel/issues/1161> for sqlite using
>> concurrent-ruby, but I wondered whether Sequel may support PostgreSQL
>> 9.6 parallel queries
>> <https://www.postgresql.org/docs/9.6/static/parallel-query.html> without
>> the use of another library?
>>
>> Many thanks
>>
>
> Parallel execution in the database of a single query is very different
> than parallel execution of separate queries on separate connections. So
> I'm not sure exactly what you are asking. Sequel supports PostgreSQL 9.6
> parallel queries exactly like all other PostgreSQL clients, in the sense
> that parallel execution in the database is not dependent on the client,
> it's dependent on the query and the database configuration.
>
> Thanks,
> Jeremy
>
--
You received this message because you are subscribed to the Google Groups
"sequel-talk" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To post to this group, send email to [email protected].
Visit this group at https://groups.google.com/group/sequel-talk.
For more options, visit https://groups.google.com/d/optout.