From: Tom Lane <tgl@sss.pgh.pa.us>
To: Wells Oliver <wells.oliver@gmail.com>
Cc: Ron <ronljohnsonjr@gmail.com>
Cc: pgsql-admin@lists.postgresql.org
Subject: Re: Very slow 101-feeling design/query..
Date: Fri, 10 Dec 2021 21:56:53 -0500
Message-ID: <13148.1639191413@sss.pgh.pa.us> (raw)
In-Reply-To: <CAOC+FBXFtjELi+HrQiL+oNySrTeVz-g3te1a3Jr97iC+VCrxWw@mail.gmail.com>
References: <CAOC+FBWG-0BH_prvkbMTFuAQ37pr+Kx3S=V=krE1qkGhojXtJw@mail.gmail.com>
<144f1205-22cc-b6ef-b0f9-21c7d271397a@gmail.com>
<CAOC+FBXFtjELi+HrQiL+oNySrTeVz-g3te1a3Jr97iC+VCrxWw@mail.gmail.com>
Wells Oliver <wells.oliver@gmail.com> writes:
> PG 13.4. Can't quite run the EXPLAIN ANALYZE since it takes so long, but
> EXPLAIN SELECT DISTINCT game_id FROM vw_joints shows (s = joints, p = plays)
I doubt you're going to get a query plan that's significantly better
than what you show here. But those tables are pretty large, so
I wonder whether you have cranked up work_mem.
One potential issue is that the planner thinks there are only
about 1829 distinct game_id values:
> HashAggregate (cost=63810150.11..63810168.40 rows=1829 width=4)
> Group Key: p.game_id
Is that about the right size of result for this?
regards, tom lane
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients using the --to and --cc options:
reply via email
To: pgsql-admin@postgresql.org
Cc: tgl@sss.pgh.pa.us, wells.oliver@gmail.com, ronljohnsonjr@gmail.com, pgsql-admin@lists.postgresql.org
Subject: Re: Very slow 101-feeling design/query..
In-Reply-To: <13148.1639191413@sss.pgh.pa.us>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
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