pg.ddx.io  pgsql-performance@postgresql.org mailing list archive  
help / color / mirror / Atom feed
why does this query not use a parallel query
2+ messages / 2 participants
[nested] [flat]

* why does this query not use a parallel query
@ 2018-03-02 16:29  Dave Cramer <davecramer@gmail.com>
  0 siblings, 1 reply; 2+ messages in thread

From: Dave Cramer @ 2018-03-02 16:29 UTC (permalink / raw)
  To: pgsql-performance

Have a query:

explain analyze SELECT minion_id FROM mob_player_mob_118 WHERE player_id =
55351078;

 QUERY PLAN
---------------------------------------------------------------------------------------------------------------------------------------------------------------------
 Index Only Scan using mob_player_mob_118_pkey on mob_player_mob_118
(cost=0.44..117887.06 rows=4623076 width=4) (actual time=0.062..3716.105
rows=4625123 loops=1)
   Index Cond: (player_id = 55351078)
   Heap Fetches: 1152408
 Planning time: 0.241 ms
 Execution time: 5272.171 ms

If I just get the count it will use a parallel query

explain analyze SELECT count(minion_id) FROM mob_player_mob_118 WHERE
player_id = 55351078;

Thanks

Dave Cramer

^ permalink  raw  reply  [nested|flat] 2+ messages in thread

* Re: why does this query not use a parallel query
@ 2018-03-02 16:44  Tom Lane <tgl@sss.pgh.pa.us>
  parent: Dave Cramer <davecramer@gmail.com>
  0 siblings, 0 replies; 2+ messages in thread

From: Tom Lane @ 2018-03-02 16:44 UTC (permalink / raw)
  To: Dave Cramer <davecramer@gmail.com>; +Cc: pgsql-performance

Dave Cramer <davecramer@gmail.com> writes:
> Have a query:
> explain analyze SELECT minion_id FROM mob_player_mob_118 WHERE player_id =
> 55351078;

>  Index Only Scan using mob_player_mob_118_pkey on mob_player_mob_118
> (cost=0.44..117887.06 rows=4623076 width=4) (actual time=0.062..3716.105
> rows=4625123 loops=1)

I don't think we have parallel IOS yet (I might be wrong).  If so,
it probably thinks this is cheaper than the best available parallel plan.

> If I just get the count it will use a parallel query

Likely a parallelized aggregation.

			regards, tom lane




^ permalink  raw  reply  [nested|flat] 2+ messages in thread


end of thread, other threads:[~2018-03-02 16:44 UTC | newest]

Thread overview: 2+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2018-03-02 16:29 why does this query not use a parallel query Dave Cramer <davecramer@gmail.com>
2018-03-02 16:44 ` Tom Lane <tgl@sss.pgh.pa.us>

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox