Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1iRz2x-0007VT-Af for pgsql-hackers@arkaria.postgresql.org; Tue, 05 Nov 2019 13:38:59 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.89) (envelope-from ) id 1iRz2v-0005b1-VG for pgsql-hackers@arkaria.postgresql.org; Tue, 05 Nov 2019 13:38:57 +0000 Received: from makus.postgresql.org ([2001:4800:3e1:1::229]) by malur.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1iRz2v-0005aC-Jn for pgsql-hackers@lists.postgresql.org; Tue, 05 Nov 2019 13:38:57 +0000 Received: from mail-yb1-xb42.google.com ([2607:f8b0:4864:20::b42]) by makus.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.92) (envelope-from ) id 1iRz2s-0002aj-I1 for pgsql-hackers@lists.postgresql.org; Tue, 05 Nov 2019 13:38:56 +0000 Received: by mail-yb1-xb42.google.com with SMTP id q18so8882740ybq.6 for ; Tue, 05 Nov 2019 05:38:54 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=2ndquadrant-com.20150623.gappssmtp.com; s=20150623; h=date:from:to:cc:subject:message-id:mime-version:content-disposition :content-transfer-encoding:in-reply-to:user-agent; bh=q3pj2t3kGGV2bcUDz8FNElttKD9gq4LRQnK0PpVyjO4=; b=eWkOeUhMMlfVfDY3GSAHlIz+B4mKsvANuqw/+EgAdK//xABeg9yxUuRkULWoOw5MaU mwhUf+z1fMOOFhBZAnnAAiuER/8nucCssBm+OxNGOJuCOtHSqn97L2YQcmr6TPk8leNt pgEVNXV0pfpq/MPRSOmzzohjQoQVC8yhnlsfNg3bmHyswywdONOczo7ZYY3H1qohJ2je A0hTxjOaro3368H79TtVEaQkEZ+0x+XFpeVOP5NlSMIs4YdrdtvsWo+uT/HaTcNO84rF xJ9Rh2uL5dEsL+mqBmhKHOJU2O47HXhwq8B+34ZEE4yAK68fpXOLlGx30vkL+2J4yOJ9 jFtQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:mime-version :content-disposition:content-transfer-encoding:in-reply-to :user-agent; bh=q3pj2t3kGGV2bcUDz8FNElttKD9gq4LRQnK0PpVyjO4=; b=iko8E0t5JzR8Gmj6Ym1vQlwQYjTO1uIR+wwIGgH6T9wuYjB3vXH70LEWxBjhN9ovZv eniZ6YSiVfFtKufMhpItVvAKi3oovGHYwPc2jaK9h/C2rmUkj0/eOeig9d+FeuxuKe6I v3MxWwpv6UQY/q+YO7KCa57P5rjf5oeT0g8uNW4p8oF9/UG1DpapRJCzq0q8VEQFtLxj o4svna02TGlk5wkAPsWAT7niYav++Tvvx5+RP6vp0pkFykmfVcGlFQxyOUzUCUc/g3pc jpAz3yuBhm9issX6udDRHXynt3/tARUDMT1N1DYbK6FOoCplvoUXuxhai7gJlAVX7jtO YTJA== X-Gm-Message-State: APjAAAWuEUyE5336MANJxilvks3gxNmziOx2UYl5NNJNkeGJGvBBsSED PVHn9hCnUcCcGXIWHXuu3yMH3A== X-Google-Smtp-Source: APXvYqy7//EqeECc2ZIeoMBjGJseOSZzKefPs4QASDswro96XEkwxj/Rk9WdGovnJuZioUXpRpQnkg== X-Received: by 2002:a25:7452:: with SMTP id p79mr5333208ybc.462.1572961133535; Tue, 05 Nov 2019 05:38:53 -0800 (PST) Received: from nimloth.alvh.no-ip.org ([66.115.168.29]) by smtp.gmail.com with ESMTPSA id c198sm19043027ywa.78.2019.11.05.05.38.52 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 05 Nov 2019 05:38:52 -0800 (PST) Received: by nimloth.alvh.no-ip.org (Postfix, from userid 1000) id 62C48300D25; Tue, 5 Nov 2019 10:38:50 -0300 (-03) Date: Tue, 5 Nov 2019 10:38:50 -0300 From: Alvaro Herrera To: Tatsuro Yamada Cc: vignesh C , Pg Hackers Subject: Re: progress report for ANALYZE Message-ID: <20191105133850.GA2494@alvherre.pgsql> MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: User-Agent: Mutt/1.10.1 (2018-07-13) List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk On 2019-Nov-05, Tatsuro Yamada wrote: > ============== > [Session1] > \! pgbench -i > create statistics pg_ext1 (dependencies) ON aid, bid from pgbench_accounts; > create statistics pg_ext2 (mcv) ON aid, bid from pgbench_accounts; > create statistics pg_ext3 (ndistinct) ON aid, bid from pgbench_accounts; Wow, it takes a long time to compute these ... Hmm, you normally wouldn't define stats that way; you'd do this instead: create statistics pg_ext1 (dependencies, mcv,ndistinct) ON aid, bid from pgbench_accounts; I'm not sure if this has an important impact in practice. What I'm saying is that I'm not sure that "number of ext stats" is necessarily a useful number as shown. I wonder if it's possible to count the number of items that have been computed for each stats object. So if you do this create statistics pg_ext1 (dependencies, mcv) ON aid, bid from pgbench_accounts; create statistics pg_ext2 (ndistinct,histogram) ON aid, bid from pgbench_accounts; then the counter goes to 4. But I also wonder if we need to publish _which_ type of ext stats is currently being built, in a separate column. -- Álvaro Herrera https://www.2ndQuadrant.com/ PostgreSQL Development, 24x7 Support, Remote DBA, Training & Services