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 1he5Ik-00069U-8W for pgsql-hackers@arkaria.postgresql.org; Thu, 20 Jun 2019 22:13:02 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.89) (envelope-from ) id 1he5Ii-0000fe-Sb for pgsql-hackers@arkaria.postgresql.org; Thu, 20 Jun 2019 22:13:00 +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 1he5Ii-0000fX-FC for pgsql-hackers@lists.postgresql.org; Thu, 20 Jun 2019 22:13:00 +0000 Received: from mail-wm1-x336.google.com ([2a00:1450:4864:20::336]) by magus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1he5If-0006ah-9m for pgsql-hackers@lists.postgresql.org; Thu, 20 Jun 2019 22:12:59 +0000 Received: by mail-wm1-x336.google.com with SMTP id x15so4500901wmj.3 for ; Thu, 20 Jun 2019 15:12:56 -0700 (PDT) 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:user-agent; bh=tupIZYjwfwQefTJV+Do4Xg4BXL/iuUxk9i7lW6u665g=; b=m87sn0hCcjpOAqTych6TxDM7sQL0YBDgYI+1lHcz/WnhNMDZlBXJGQvE4dMddndNPr jCoz7UmSzbad4WWcv9gSed99juJX6s8zL+7nXhiMW/SRZLwGGkb+q83tSy9GZfhb50Ap 2+vtZYGdTooBC6pige9n61L33clOvSU1xkUspfvHINYXaYQ/n2LW4OPKDQBphJ9BnLC1 BAxioDZuPA3oDwWzc7UVEIUA3bcBR0JZRJKZOtmr0Tt9rw5QwFjQMLuTG12nYCW5SS5l FjupeuasgaQSRTSew5U7LJgqSH8Y9WJ1Qaobs8fJPpF/ZGBOPA3eAFqOUuxjKhIikAau v3gA== 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:user-agent; bh=tupIZYjwfwQefTJV+Do4Xg4BXL/iuUxk9i7lW6u665g=; b=lEqwkhLZ0FqWEpg3neDCwG8LY3a/uAZwXhVwbsL+00/JcQH8SB7Sg99aAL0xdjBDDE +/7ISIhXMyl/vd9lpiVnPVC4trljhGz5Ik5oyyCC6EXUL93+TcKkJqgWOfHGg1EnKDo8 OkeQDNhwcdoRePzfvkDZ8skDJae3whu7X0maERLFL4xDZ6yRw2MIElkSp1yVNe7Lsa5y IRg2blFSwApb+i6WIkx3gB5zQGZiq80ZxObWF5zdFz3ly1C+BP7LXByDfeQUunzC4Wyp m+yrjkEqHBoka1k7+UdAAlYdMXbvcC1YOA2RuRR8MEXJEV709u6ABpNYZ3TLkBdRl1Ah gQEQ== X-Gm-Message-State: APjAAAUac3pRnXbQJuJZJBGb8Jy7UUPEmv2XdDCXRtiYHZf8pitOTKxG +Op4xrcfvmmlLApTGoF5y1w01A== X-Google-Smtp-Source: APXvYqxDSIXWbYfFaZo2uhxEwJrIuO5gIC7NsC4YheHbAqADvbefkNefgYlub+2HBWJQ7J7ENKNKuw== X-Received: by 2002:a7b:cc86:: with SMTP id p6mr955642wma.123.1561068774889; Thu, 20 Jun 2019 15:12:54 -0700 (PDT) Received: from localhost ([212.170.219.26]) by smtp.gmail.com with ESMTPSA id 32sm1638876wra.35.2019.06.20.15.12.51 (version=TLS1_3 cipher=AEAD-AES256-GCM-SHA384 bits=256/256); Thu, 20 Jun 2019 15:12:51 -0700 (PDT) Date: Fri, 21 Jun 2019 00:12:50 +0200 From: Tomas Vondra To: Dean Rasheed Cc: PostgreSQL Hackers Subject: Re: Multivariate MCV list vs. statistics target Message-ID: <20190620221250.jk62m4j7kr77qkzg@development> References: <20190618213357.vli3i23vpkset2xd@development> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii; format=flowed Content-Disposition: inline In-Reply-To: User-Agent: NeoMutt/20180716-1444-295967-dirty List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk On Thu, Jun 20, 2019 at 08:08:44AM +0100, Dean Rasheed wrote: >On Tue, 18 Jun 2019 at 22:34, Tomas Vondra wrote: >> >> One slightly inconvenient thing I realized while playing with the >> address data set is that it's somewhat difficult to set the desired size >> of the multi-column MCV list. >> >> At the moment, we simply use the maximum statistic target for attributes >> the MCV list is built on. But that does not allow keeping default size >> for per-column stats, and only increase size of multi-column MCV lists. >> >> So I'm thinking we should allow tweaking the statistics for extended >> stats, and serialize it in the pg_statistic_ext catalog. Any opinions >> why that would be a bad idea? >> > >Seems reasonable to me. This might not be the only option we'll ever >want to add though, so perhaps a "stxoptions text[]" column along the >lines of a relation's reloptions would be the way to go. > I don't know - I kinda dislike the idea of stashing stuff like this into text[] arrays unless there's a clear need for such flexibility (i.e. vision to have more such options). Which I'm not sure is the case here. And we kinda have a precedent in pg_attribute.attstattarget, so I'd use the same approach here. >> I suppose it should be part of the CREATE STATISTICS command, but I'm >> not sure what'd be the best syntax. We might also have something more >> similar to ALTER COLUMNT, but perhaps >> >> ALTER STATISTICS s SET STATISTICS 1000; >> >> looks a bit too weird. >> > >Yes it does look a bit weird, but that's the natural generalisation of >what we have for per-column statistics, so it's probably preferable to >do that rather than invent some other syntax that wouldn't be so >consistent. > Yeah, I agree. regards -- Tomas Vondra http://www.2ndQuadrant.com PostgreSQL Development, 24x7 Support, Remote DBA, Training & Services