Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1jgV1s-00031I-Kv for pgsql-performance@arkaria.postgresql.org; Wed, 03 Jun 2020 15:10:08 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1jgV1q-0000sx-Au for pgsql-performance@arkaria.postgresql.org; Wed, 03 Jun 2020 15:10:06 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1jgV1q-0000s5-0l for pgsql-performance@lists.postgresql.org; Wed, 03 Jun 2020 15:10:06 +0000 Received: from mail-io1-xd2e.google.com ([2607:f8b0:4864:20::d2e]) by magus.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.92) (envelope-from ) id 1jgV1n-0001Kl-6S for pgsql-performance@lists.postgresql.org; Wed, 03 Jun 2020 15:10:05 +0000 Received: by mail-io1-xd2e.google.com with SMTP id q8so2617847iow.7 for ; Wed, 03 Jun 2020 08:10:02 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=telsasoft-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=35UKOV1bz8HYJfJz5OMOqcwB9pHEj73HuW5ZJ1ITsxk=; b=JtABZcLY8+/CU4/G7gwSUXuT4e+kCwJa2WjOlVsKBiI9Wvr2GLK85NS2aIHMF5nyjh tVwiN7PzxHAQA8d1WKNfh+ACopaa2Yd0SRM90L34qibSh355zFFulOsQGEwc2uYXZ6m1 A971zaGMv1jVYknSqb31e7yhMoJAN4xHoLZLhM9pddiwHkmn/sBUphIjSW0Kbn9NK1As x9vP6hagNe3Xvcqgg2J2OzIIeka+3impkYAnXxMjM4xtiEam4pJi1gWsMoIwG5q0FIpb /dVnZ048V84UwoEVOwO61EiKtHilH3/0RQTW/TSG1zisKyXjy1PXaQsD/hnLpmH86hvC /2Vg== 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=35UKOV1bz8HYJfJz5OMOqcwB9pHEj73HuW5ZJ1ITsxk=; b=uMhtNEG625PT/dSmfEuY1TcRN57sRYm7HOtf/rNCT/IRfEb69FFHcf/LpYc7819uvB IRrJmYIZW3n4pK74fy0A+TFdu719fzsSs09LJCCkJPaFdxeHPYiNLr9c6vmr+H1J9ez1 RV6QlftsrobokVRSuVaUdzruxZlJwXXJzoGDVyEUPn1OU9o4bQPA5CGKjRbfgu/hNSOk GsYnDWyowtNUSmDK4p65QhC74L6L2zm6NKDom1FC1TBqGhGnfP+upWGu03Hv+cGuxCo3 B3NIhe4ex7kpLDaJRxppn7xOEY+MFsY8P1jghmChaW949V/U1OyxYCHB8kMjw0KSWbkV kLpQ== X-Gm-Message-State: AOAM531xN40dc4WzwsrxfvHZdanEn/eR2zHXpfT+Y9rxFLPEKsTLWLA3 ecFiFZcrD0vJCNOCqOxnCvJbSW/ky1KqDA== X-Google-Smtp-Source: ABdhPJyoHMfyOJk0uC5SfrPgeTopCOVHbeA8PcXz6YWu8fqen3t3X7VSNXNAG3+bVy2dJosBD24Qzg== X-Received: by 2002:a02:9105:: with SMTP id a5mr286441jag.107.1591197001035; Wed, 03 Jun 2020 08:10:01 -0700 (PDT) Received: from pryzbyj.telsasoft (charmander.telsasoft.com. [50.244.222.1]) by smtp.gmail.com with ESMTPSA id 2sm1208802ila.0.2020.06.03.08.09.59 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Wed, 03 Jun 2020 08:10:00 -0700 (PDT) Received: by pryzbyj.telsasoft (Postfix, from userid 1000) id 43BA98006D0; Wed, 3 Jun 2020 10:09:59 -0500 (CDT) Date: Wed, 3 Jun 2020 10:09:59 -0500 From: Justin Pryzby To: Oleksandr Shulgin Cc: pgsql-performance@lists.postgresql.org Subject: Re: When to use PARTITION BY HASH? Message-ID: <20200603150959.GP30144@telsasoft.com> References: <20200602173353.GB30144@telsasoft.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.9.4 (2018-02-28) List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk On Wed, Jun 03, 2020 at 09:45:48AM +0200, Oleksandr Shulgin wrote: > I see. So it works with low cardinality in the partitioned column. With > high cardinality an index scan on an unpartitioned table would be > preferable I guess. > > The documentation page I've linked only contains examples around > partitioning BY RANGE. I believe it'd be helpful to extend it with some > meaningful examples for LIST and HASH partitioning. I agree. I think it would also be useful to mention the "benefits" which aren't likely to apply to hash partitioning. Would you want to propose an example to include ? Eventually it needs to be submitted as a patch to -hackers. -- Justin