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 1icujb-000082-Qc for pgsql-hackers@arkaria.postgresql.org; Thu, 05 Dec 2019 17:16:12 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.89) (envelope-from ) id 1icujY-0007Mu-QA for pgsql-hackers@arkaria.postgresql.org; Thu, 05 Dec 2019 17:16:08 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1icujY-0007Ml-D0 for pgsql-hackers@lists.postgresql.org; Thu, 05 Dec 2019 17:16:08 +0000 Received: from mail-wr1-x443.google.com ([2a00:1450:4864:20::443]) by magus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1icujO-0001JT-IQ for pgsql-hackers@postgresql.org; Thu, 05 Dec 2019 17:16:05 +0000 Received: by mail-wr1-x443.google.com with SMTP id y11so4567084wrt.6 for ; Thu, 05 Dec 2019 09:15:58 -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:references:mime-version :content-disposition:in-reply-to; bh=oZ9lTOiih9YhAFGpUCZO24dpjDVUL6wkQh3KTDyPYTY=; b=OkBy/ifjp6xqf+nrBJlorWBQb2lmwiArMXr6r3xRmPlM821Zbc18PRq1mvv7wKA9dt rR+6dLbp4bizGlPDzS7Z9kYzoT1FEnoJ+0G2jl/9AIFdBQYshbZ7NiKALdnrGlQdPIIF ADG/tDqJGyie9KDNsDL+935TVODX/uH+XV9wxPZ9KBwcjU9da3MuMPNbwifA+jtj9WrC XCgb9iOIeC29iWN7XdX/Vkt22qBTKd0NmElS4iQCqYm6jz+6/siMTQSvFa53L5H37a2F 7ULUGK8JYfUCp94u8dDm6JWgQBAZKHx+0a2OrFIWONJ1PaCl6of3cK1eLZO0EQyWsyzr rczA== 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:references :mime-version:content-disposition:in-reply-to; bh=oZ9lTOiih9YhAFGpUCZO24dpjDVUL6wkQh3KTDyPYTY=; b=K/gchUFQ8lxK56b9Y+5fR7WZuyd8/CDQ3CFOgB9nY7rpQZ6mX3wBYIa/2IdiDX5eMo k/CB4PBmY9hLYTr0am9vFOUPY07/qyTMsfC88viTmb6L8cSAspotB1DwGpF+RxwyVR+1 XTAZ0CeZ6wQVammxGNJLG1VGfkc66O9U6ja97DYZ8GP3z0q8L5abGVWVko9XkPEPClSz XmouDybH2VfPazLvH4GT1PGWIUAXlpf+CkjFMJ9KXqNrNtaMzkn3r/6s/sy5KUZCt4Hw Y29BI2WkI1fsIzgLTrv7MX3G0bcoDG4awyqIVdSEj2QBjb8oaZe2Sy5giXOtCV5i1KVf sNUg== X-Gm-Message-State: APjAAAUD70Rnyo+HTViIFJliKVwDtZrt0gH0Ax9mwQFXb2IseBz+pPbc C5M1zSHu8D1qp7l+zZ6U7cWdIg== X-Google-Smtp-Source: APXvYqzZwtCU32Fq/28dYaMvYn8r8pG9HIvhGzddVjSc2S2BWmDt7W2aNynGxeqtUF9cLpiA0k/97g== X-Received: by 2002:a5d:6ac3:: with SMTP id u3mr11726639wrw.25.1575566157176; Thu, 05 Dec 2019 09:15:57 -0800 (PST) Received: from localhost (static-84-42-175-93.net.upcbroadband.cz. [84.42.175.93]) by smtp.gmail.com with ESMTPSA id o15sm13877543wra.83.2019.12.05.09.15.55 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 05 Dec 2019 09:15:56 -0800 (PST) Date: Thu, 5 Dec 2019 18:15:54 +0100 From: Tomas Vondra To: Mark Dilger Cc: PostgreSQL Hackers Subject: Re: Using multiple extended statistics for estimates Message-ID: <20191205171554.leclyueirbwun7dp@development> References: <97932e1d-53f1-bad3-efc2-1d98cab70727@gmail.com> <0da76f1f-5f9c-3ce3-3ac6-042d2a18430a@gmail.com> <20191110173428.w5klequcmb6gawaa@development> <20191113152823.jdpertc73gfo2mk7@development> <2e183f8d-1304-6024-90de-1017a861a235@gmail.com> <20191114155541.zliellgi2if4bb5f@development> <20191114200420.c3x2jf7ywzs23uzo@development> <20191201190858.oielyi5rpfg5mc23@development> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii; format=flowed Content-Disposition: inline In-Reply-To: <20191201190858.oielyi5rpfg5mc23@development> List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk On Sun, Dec 01, 2019 at 08:08:58PM +0100, Tomas Vondra wrote: >On Sat, Nov 30, 2019 at 03:01:31PM -0800, Mark Dilger wrote: >> >>Are you planning to submit a revised patch for this? >> > >Yes, I'll submit a rebased version of this patch shortly. I got broken >because of the recent fix in choose_best_statistics, shouldn't take long >to update the patch. I do have a couple more related patches in the >queue, so I want to submit them all at once. > OK, here we go - these two patched allow applying multiple extended statistics, both for MCV and functional dependencies. Functional dependencies are simply merged and then applied at once (so withouth choose_best_statistics), statistics are considered in greedy manner by calling choose_best_statistics in a loop. I do have some additional enhancements in the queue, but those are not fully baked yet, so I'll post them later in separate patches. regards -- Tomas Vondra http://www.2ndQuadrant.com PostgreSQL Development, 24x7 Support, Remote DBA, Training & Services