Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1qyHV9-007KNP-2l for pgsql-hackers@arkaria.postgresql.org; Wed, 01 Nov 2023 20:07:43 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.94.2) (envelope-from ) id 1qyHV6-008dSJ-Id for pgsql-hackers@arkaria.postgresql.org; Wed, 01 Nov 2023 20:07:40 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1qyHV6-008dSB-81 for pgsql-hackers@lists.postgresql.org; Wed, 01 Nov 2023 20:07:40 +0000 Received: from mail-wm1-x32e.google.com ([2a00:1450:4864:20::32e]) by magus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 (Exim 4.94.2) (envelope-from ) id 1qyHUy-004DAf-64 for pgsql-hackers@lists.postgresql.org; Wed, 01 Nov 2023 20:07:38 +0000 Received: by mail-wm1-x32e.google.com with SMTP id 5b1f17b1804b1-40859c466efso1311315e9.3 for ; Wed, 01 Nov 2023 13:07:31 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=enterprisedb.com; s=google; t=1698869250; x=1699474050; darn=lists.postgresql.org; h=content-transfer-encoding:in-reply-to:from:content-language :references:cc:to:subject:user-agent:mime-version:date:message-id :from:to:cc:subject:date:message-id:reply-to; bh=HthFS34Ayet2zN/hkWJL8QlD2UkSIb7/IF6jrkZZR2Q=; b=SNAYnAbS3g7e8lBS2uGJqRhRPZJa7jxp+KgCwBqiiSbhQQhnv8oWbm34fv4f0Ua1Tl TqAS7bdFNK7teQ3LY4EsZPkU6auyfH1IoxVFTYmBaz/XZm7KIx4vW/tMUsKZj/Q39VM/ gCIdTFmNL2rFVqLWPvkHaNLbHs/f8pLG2JAlNG2tLHcrw7KPv4ReQAfUyZKKMjqckEzL qlHbOhduvxBtEXUK6RDSyo9QMcmhUn0k8WzZyGTe4m6yrtac2K4WI38FNkFkNrXiopy5 h2AHeEojRQEDYu6YwwRLYeUE/zwPWHhsRE+AixgjoIT0mtUSjtbcZG7ZkeIzNI/ex0jE O7Pw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1698869250; x=1699474050; h=content-transfer-encoding:in-reply-to:from:content-language :references:cc:to:subject:user-agent:mime-version:date:message-id :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=HthFS34Ayet2zN/hkWJL8QlD2UkSIb7/IF6jrkZZR2Q=; b=s3eRupe1sVYXC/6VO1vxjqahHMHyADxzE08lxWUhuaPA/JN8ida3MWTi7PIdS515Co PfRC+k0Sd2bU80iDEBVnGUbt650H18rYvoJ/Kj8DoDsxyeHnVklSq5Pa1DamAVeUb9Kc AwUXtkRkpt30EniSaYb7nakWjymcYfnIMr+v44sX94mMLI0rHWjaSVt7spBNthzl7an+ gC+njwYRhjo7RTWruR7wbYhxVYrTudTlYdUwHkSfB6DsuNkkcrBpi+FuoA/eXB9/J66j V7LoU0q1mgk6nXr04AwyzaT/LU606LTYCsS/c8PHZ4IwmhYp4qdRDG4HRSqaUxxnD3V3 5rRA== X-Gm-Message-State: AOJu0YwmbBSx/j0NcWWWnRTAeJtW2HOMjPwpC/pMR8/ituaPDPzRiC3H 6frF1flbBggLxITCoBUBi6jfM580S6fVGZlMQM8= X-Google-Smtp-Source: AGHT+IGXfPSrCnETIaqJWZ7fHzRo58iLDVrTAUHf2ljcf3LP4gWmxtYmHqEGQT51bmGgdtinEV8CEA== X-Received: by 2002:a05:600c:154e:b0:408:4083:fbf2 with SMTP id f14-20020a05600c154e00b004084083fbf2mr13628402wmg.22.1698869250258; Wed, 01 Nov 2023 13:07:30 -0700 (PDT) Received: from [10.137.0.17] (ip-86-49-228-220.bb.vodafone.cz. [86.49.228.220]) by smtp.gmail.com with ESMTPSA id t12-20020adfe44c000000b003253523d767sm564149wrm.109.2023.11.01.13.07.29 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Wed, 01 Nov 2023 13:07:29 -0700 (PDT) Message-ID: Date: Wed, 1 Nov 2023 21:07:27 +0100 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.13.0 Subject: Re: Statistics Import and Export To: Corey Huinker , Ashutosh Bapat Cc: pgsql-hackers@lists.postgresql.org References: Content-Language: en-US From: Tomas Vondra In-Reply-To: Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk On 10/31/23 08:25, Corey Huinker wrote: > > Attached is v2 of this patch. > > New features: > * imports index statistics. This is not strictly accurate: it > re-computes index statistics the same as ANALYZE does, which is to > say it derives those stats entirely from table column stats, which > are imported, so in that sense we're getting index stats without > touching the heap. Maybe I just don't understand, but I'm pretty sure ANALYZE does not derive index stats from column stats. It actually builds them from the row sample. > * now support extended statistics except for MCV, which is currently > serialized as an difficult-to-decompose bytea field. Doesn't pg_mcv_list_items() already do all the heavy work? regards -- Tomas Vondra EnterpriseDB: http://www.enterprisedb.com The Enterprise PostgreSQL Company