Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtp (Exim 4.84_2) (envelope-from ) id 1c222g-00037O-0o for pgsql-performance@arkaria.postgresql.org; Wed, 02 Nov 2016 20:21:50 +0000 Received: from localhost ([127.0.0.1] helo=postgresql.org) by malur.postgresql.org with smtp (Exim 4.84_2) (envelope-from ) id 1c222f-0000b1-Ch for pgsql-performance@arkaria.postgresql.org; Wed, 02 Nov 2016 20:21:49 +0000 Received: from makus.postgresql.org ([2001:4800:1501:1::229]) by malur.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.84_2) (envelope-from ) id 1c220z-0005tD-4y for pgsql-performance@postgresql.org; Wed, 02 Nov 2016 20:20:05 +0000 Received: from mail-yw0-x22e.google.com ([2607:f8b0:4002:c05::22e]) by makus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.84_2) (envelope-from ) id 1c220r-0004Rn-J0 for pgsql-performance@postgresql.org; Wed, 02 Nov 2016 20:20:03 +0000 Received: by mail-yw0-x22e.google.com with SMTP id r204so23487071ywb.0 for ; Wed, 02 Nov 2016 13:19:57 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=telsasoft-com.20150623.gappssmtp.com; s=20150623; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to:user-agent; bh=frWl0+Mi0DWzzC8CWQLUaw4u4hECKVX9GDH1PwsDbwQ=; b=R81Pn+96d+BLeks7OJfBrgQQEXq5PjRbcw1Hj//hkddhTGhPYOGp5a12O2nvT1zCfj o5VyfK493jx1tYfmz2ZVTCS57AYDzsuOOQabxafKSb6FZRl1c4PZuFnowEdPfBDl5fWv Zlc2X6bELw0S0vjW2zbVbFoH4ntb19dWHyDbWIqm08qwfleijdCNXANT05b9X7dqUI1P D3aAXe8DbqSQlKhYvWK6g68j3D30Qs7kc++AcoIvpu++xYOaegrXXYgALTZXdz760v8b 8gDtizm/BaAB+ZHP0IfXdCebGbHabOLqdZyKjpo2NHHS0CvTG24veTRk2RA1+6wIWmnQ 2kYg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to:user-agent; bh=frWl0+Mi0DWzzC8CWQLUaw4u4hECKVX9GDH1PwsDbwQ=; b=ftlfvkOmiBRvPtl/1HP+jgp6Jh4qiIHbAtOEs06e2XZwB5OM+TuQDUGvL/Mt1LpWU2 0+NZaIJWabOWdhy7NKhlKOIVAFZ1QIzR2dAVKgQeJ/s1SdAyLg6WP7poCbkuSXxPKOxb 87etbU7XownP59W0D9D8QOTP75wPLixRbCxKjik1e5qg0tDZGaGmG6WgTOWb0HrTB0vk zr85pZmI8JmtFg+bmptmcvkZDtHNeGU5q6l5k09hl2eu5JyPFZkhjfTIElVcQoYnj5p0 iqqTosQ8VDodiXBvk3pu8SyEC5XhIqrQ0yjKzDZ8pqvQLVKFX/OI7WUKQGrllM9DpYEf zVfg== X-Gm-Message-State: ABUngvdmRpPGPm4ndG+c7Lu9mgfFPuMc6fvJpxFXff6Vz/Vm0tKlnUTT6MqoLgMTS9VXQg== X-Received: by 10.36.46.204 with SMTP id i195mr3699177ita.91.1478117996702; Wed, 02 Nov 2016 13:19:56 -0700 (PDT) Received: from pryzbyj (charmander.telsasoft.com. [50.244.222.1]) by smtp.gmail.com with ESMTPSA id n62sm1460268ith.2.2016.11.02.13.19.56 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 02 Nov 2016 13:19:56 -0700 (PDT) Received: by pryzbyj (Postfix, from userid 1000) id 79EB2801731; Wed, 2 Nov 2016 15:19:55 -0500 (CDT) Date: Wed, 2 Nov 2016 15:19:55 -0500 From: Justin Pryzby To: Tom Lane Cc: pgsql-performance@postgresql.org Subject: Re: no MCV list of tiny table with unique columns Message-ID: <20161102201955.GB2139@telsasoft.com> References: <20161102185318.GA3987@telsasoft.com> <26162.1478117146@sss.pgh.pa.us> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <26162.1478117146@sss.pgh.pa.us> User-Agent: Mutt/1.5.23 (2014-03-12) X-Pg-Spam-Score: -2.6 (--) List-Archive: List-Help: List-ID: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: X-Mailing-List: pgsql-performance Precedence: bulk Sender: pgsql-performance-owner@postgresql.org On Wed, Nov 02, 2016 at 04:05:46PM -0400, Tom Lane wrote: > Justin Pryzby writes: > > I believe the join is being (badly) underestimated, leading to a crappy plan > > involving multiple nested loop joins, which takes 2.5 hours instead of a > > handful of seconds; I believe that might be resolved by populating its MCV > > list.. > > With only two rows in the table, I'm not real sure why you'd need an MCV > list. Could we see the actual problem query (and the other table > schemas), rather than diving into the code first? Sigh, yes, but understand that it's a legacy report which happens to currently be near the top of my list of things to improve: https://explain.depesz.com/s/5rN6 The relevant table is involved three times: Seq Scan on two_november mike_oscar (cost=0.000..1.020 rows=2 width=18) (actual time=0.010..0.010 rows=2 loops=1) Seq Scan on echo_oscar foxtrot (cost=0.000..209.860 rows=6,286 width=13) (actual time=0.014..2.271 rows=5,842 loops=1) Seq Scan on two_november xray_yankee_alpha (cost=0.000..1.020 rows=2 width=18) (actual time=0.017..0.019 rows=2 loops=1) Justin -- Sent via pgsql-performance mailing list (pgsql-performance@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-performance