Re: Getting an index scan to be a parallel index scan

2023-02-01 Thread Alex Kaiser
Okay after reading http://rhaas.blogspot.com/2018/06/using-forceparallelmode-correctly.html I do see that I was using force_parallel_mode incorectly and wouldn't have gotten what I wanted even if the original query was possible to parallelize. > Maybe, but unfairness multiplies if it's part of a

Re: Getting an index scan to be a parallel index scan

2023-02-01 Thread David Rowley
On Thu, 2 Feb 2023 at 14:49, Thomas Munro wrote: > If I had more timerons myself, I'd like to try to make parallel > function scans, or parallel CTE scans, work... I've not really looked in detail but I thought parallel VALUES scan might be easier than those two. David

Re: Getting an index scan to be a parallel index scan

2023-02-01 Thread Thomas Munro
On Thu, Feb 2, 2023 at 1:54 PM Alex Kaiser wrote: > Thanks for the explanation. Yes, that is the query plan I was imagining. I do > see how chopping it up could result in an unfair distribution. But my counter > to that would be that wouldn't chopping it up still be better than not. If >

Re: Getting an index scan to be a parallel index scan

2023-02-01 Thread Alex Kaiser
Justin, I did try changing min_parallel_index_scan_size / min_parallel_table_scan_size and didn't see any change (the below is with force_parallel_mode = off): postgres=# set min_parallel_index_scan_size = 0; SET postgres=# set min_parallel_table_scan_size = 0; SET postgres=# explain select *

Re: Getting an index scan to be a parallel index scan

2023-02-01 Thread Thomas Munro
On Wed, Feb 1, 2023 at 6:39 PM Alex Kaiser wrote: > select * from testing where id in (1608377,5449811, ... <1000 random ids> > ,4654284,3558460); > > Essentially I have a list of 1000 ids and I would like the rows for all of > those ids. > > This seems like it would be pretty easy to

Re: Getting an index scan to be a parallel index scan

2023-02-01 Thread Justin Pryzby
On Wed, Feb 01, 2023 at 11:22:47AM -0800, Alex Kaiser wrote: > I've never messed around with extended statistics, but I'm not sure how > they would help here. From what I've read they seem to help when your query > is restricting over multiple columns. Since this query is only on one > column I'm

Re: Getting an index scan to be a parallel index scan

2023-02-01 Thread Alex Kaiser
Rainier, I tried using the any syntax (had to modify your query slightly) and it didn't result in any change in the query plan. postgres=# explain select * from testing where id = ANY(array[1608377,5449811, ... ... ,4654284,3558460]::integer[]); QUERY PLAN

Re: Getting an index scan to be a parallel index scan

2023-02-01 Thread David Rowley
On Wed, 1 Feb 2023 at 18:39, Alex Kaiser wrote: > postgres=# set force_parallel_mode = on; There's been a bit of debate about that GUC and I'm wondering how you came to the conclusion that it might help you. Can you share details of how you found out about it and what made you choose to set it

Re: Getting an index scan to be a parallel index scan

2023-02-01 Thread Ranier Vilela
Em qua., 1 de fev. de 2023 às 02:39, Alex Kaiser escreveu: > Hello, > > I'm trying to get the following query to use a plan with parallelism, but > I haven't been successful and would like some advice. > > The schema and table that I'm using is this: > > CREATE TABLE testing( >id INT, >

Getting an index scan to be a parallel index scan

2023-01-31 Thread Alex Kaiser
Hello, I'm trying to get the following query to use a plan with parallelism, but I haven't been successful and would like some advice. The schema and table that I'm using is this: CREATE TABLE testing( id INT, info INT, data_one TEXT, data_two TEXT, primary key(id, info) );