Received: from localhost (unknown [200.46.204.183]) by mail.postgresql.org (Postfix) with ESMTP id 8DB476501CA for ; Thu, 11 Dec 2008 20:23:59 -0400 (AST) Received: from mail.postgresql.org ([200.46.204.86]) by localhost (mx1.hub.org [200.46.204.183]) (amavisd-maia, port 10024) with ESMTP id 12722-06 for ; Thu, 11 Dec 2008 20:23:53 -0400 (AST) X-Greylist: domain auto-whitelisted by SQLgrey-1.7.6 Received: from mail-bw0-f14.google.com (mail-bw0-f14.google.com [209.85.218.14]) by mail.postgresql.org (Postfix) with ESMTP id 373A164FE91 for ; Thu, 11 Dec 2008 20:23:53 -0400 (AST) Received: by bwz7 with SMTP id 7so2612881bwz.19 for ; Thu, 11 Dec 2008 16:23:51 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:message-id:date:from:to :subject:cc:in-reply-to:mime-version:content-type :content-transfer-encoding:content-disposition:references; bh=6/VfK5zAFPoR7Ghh1x4Ml3w/iLkCyr+B+B0ikNsX/ps=; b=TyPEk/Sku2tZYmhbSiHluYB5PuzGEdhtT4v01wSTJUwnXlm+IrcLyU1oDhuHW3P8W1 vG3q92IWCYBI0jYdhZrrsqHV4ZkMr0K9uaEWZZrf4DrGAZ1V318KA3lP6O8t56eIX6i5 9lfSe0LszRLXG07wFZ4ySfALtoKoCvK8IdFqQ= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=message-id:date:from:to:subject:cc:in-reply-to:mime-version :content-type:content-transfer-encoding:content-disposition :references; b=oh+usOtWerSLvVcxfAVm3UHDoGILpo+KMetyHxXHUfA6NfvNn0UIDSVayEs9CUk4LD xxixHTzcDJZpLDiXEYtDyOfToOjGqGdFn36dBIns/17a77pVJcCiitCW8s4sbifr87ay rdk5cjr9l1171KlgEo6rU1f0s4ep6wleIUhcQ= Received: by 10.181.145.6 with SMTP id x6mr1067240bkn.25.1229040755639; Thu, 11 Dec 2008 16:12:35 -0800 (PST) Received: by 10.181.138.17 with HTTP; Thu, 11 Dec 2008 16:12:35 -0800 (PST) Message-ID: <6fa3b6e20812111612m74555e44sfd3ef0ce5431ea9d@mail.gmail.com> Date: Thu, 11 Dec 2008 16:12:35 -0800 From: "Nathan Boley" To: "Vladimir Sitnikov" Subject: Re: benchmarking the query planner Cc: "Tom Lane" , "Robert Haas" , "Gregory Stark" , "Kevin Grittner" , "jd@commandprompt.com" , "Josh Berkus" , "Greg Smith" , pgsql-hackers@postgresql.org In-Reply-To: <1d709ecc0812111447m7b48bf4eg1b74e454ee3e7b7b@mail.gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Content-Disposition: inline References: <603c8f070812061019r5aca3aajeaa5493b11c5feff@mail.gmail.com> <603c8f070812101828p1bd7df49yb8c916adedb49fe1@mail.gmail.com> <9565.1229018968@sss.pgh.pa.us> <603c8f070812111104xbfd86eaw8c0b64c4869c0e8@mail.gmail.com> <11006.1229029042@sss.pgh.pa.us> <1d709ecc0812111319h6f99dec2kf9fb858ae6481a8a@mail.gmail.com> <11419.1229030908@sss.pgh.pa.us> <1d709ecc0812111354m2f5a7ba5gebc9e1d50b9de913@mail.gmail.com> <12251.1229034420@sss.pgh.pa.us> <1d709ecc0812111447m7b48bf4eg1b74e454ee3e7b7b@mail.gmail.com> X-Virus-Scanned: Maia Mailguard 1.0.1 X-Spam-Status: No, hits=0 tagged_above=0 required=5 tests=none X-Spam-Level: X-Archive-Number: 200812/839 X-Sequence-Number: 129468 >> What is the specific difference between what you are talking about and >> what scalarineqsel already implements? > > Hmm... Northing new. Feel sorry for bothering you. I did not realize > histograms are implemented. > Well, ISTM there is a profound difference. For scalarineqsel we care about the total number of values in a bucket. For eqsel we care about the total number of *distinct* values in each bucket ( which we don't track ). IMHO, the whole idea of increasing mcv's seems a mistake. Why not use the limited storage in pg_statistic to try and estimate the selectivity for ranges of values rather than a single value? That gives way better coverage of the distribution. If the number of values is too high to fit in a single bucket we put it in an mcv slot anyways. *That* should be the mechanism by which the number of mcv's increases. I guess this is a bit off topic for the middle of a commit fest though. -Nathan