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 1lAyH1-0005hV-27 for pgsql-general@arkaria.postgresql.org; Sat, 13 Feb 2021 16:59:59 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1lAyGx-0003Gw-63 for pgsql-general@arkaria.postgresql.org; Sat, 13 Feb 2021 16:59:55 +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 1lAgKs-00011i-3D for pgsql-general@lists.postgresql.org; Fri, 12 Feb 2021 21:50:46 +0000 Received: from forward2-smtp.messagingengine.com ([66.111.4.226]) by magus.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1lAgKo-0001rd-3a for pgsql-general@postgresql.org; Fri, 12 Feb 2021 21:50:45 +0000 Received: from compute5.internal (compute5.nyi.internal [10.202.2.45]) by mailforward.nyi.internal (Postfix) with ESMTP id 442331940E4C for ; Fri, 12 Feb 2021 16:50:40 -0500 (EST) Received: from imap1 ([10.202.2.51]) by compute5.internal (MEProxy); Fri, 12 Feb 2021 16:50:40 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=content-type:date:from:message-id :mime-version:subject:to:x-me-proxy:x-me-proxy:x-me-sender :x-me-sender:x-sasl-enc; s=fm2; bh=r6eHXDqKDi6pt89gw2+RmSvX2nxIB RcQwjID9UNE5AA=; b=riEMHbPD9fVFM02X3OP2k3alVANI87MZ6oJLRVu/Wx0mp ICIpGqbzwoIUsBCXhon3S48/AzcBodEYa664cilBiHCgNLZBfhGRZyTFc/EnO+N8 MNhxThrSHm2dKSzIKbwahKjtUvJ83m9/vc2C+SDn3V6zr7xEzaKlg1bj21vdpNXD mRS6SXgmgH6V0bAuK25bdWH6WmgtsjxPJI/bWjjj+pFfj2TJ4T2HRA9dPrvMPnWt wNFxcAdsbgVK0F9Z86uHLYMCx/P5mE8mbpY0U4wlXuMJ6jm3rTro/hnqUfDJKVNY zjjZTeM2zyEqVqAPPcELTh8cluLciK5s5HspEdDUQ== X-ME-Sender: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgeduledriedugdduheeiucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfqfgfvpdfurfetoffkrfgpnffqhgen uceurghilhhouhhtmecufedttdenucenucfjughrpefofgggkfffhffvufgtsehttdertd erredtnecuhfhrohhmpedfufgvrghmuhhsucetsghshhgvrhgvfdcuoehsrggsshhhvghr vgesrghluhhmnhhirdhprhhinhgtvghtohhnrdgvughuqeenucggtffrrghtthgvrhhnpe ethfetgedvffelueevudfgiefgtedtvefguedtieelhfelkeeggfeffeehfeekgfenucff ohhmrghinhepfhgrrhgruggrhidrrghipdhgihhthhhusgdrtghomhdplhhinhhkvgguih hnrdgtohhmnecuvehluhhsthgvrhfuihiivgeptdenucfrrghrrghmpehmrghilhhfrhho mhepshgrsghshhgvrhgvsegrlhhumhhnihdrphhrihhntggvthhonhdrvgguuh X-ME-Proxy: Received: by mailuser.nyi.internal (Postfix, from userid 501) id 3C133130005D; Fri, 12 Feb 2021 16:50:39 -0500 (EST) X-Mailer: MessagingEngine.com Webmail Interface User-Agent: Cyrus-JMAP/3.5.0-alpha0-141-gf094924a34-fm-20210210.001-gf094924a Mime-Version: 1.0 Message-Id: <19b02e4e-c2b4-4853-868e-2541965da96a@www.fastmail.com> Date: Fri, 12 Feb 2021 16:50:18 -0500 From: "Seamus Abshere" To: pgsql-general@postgresql.org Subject: Why is Postgres only using 8 cores for partitioned count? Content-Type: text/plain List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk hi, How can I convince Postgres to use more than 8 cores? I've got an r6gd.16xlarge with 64 vCpus and 512gb RAM running Postgres 13.1 on Ubuntu 20.04. CREATE TABLE tbl ( [...] ) PARTITION BY HASH (address_key); It has 64 partitions - e.g. FOR VALUES WITH (modulus 64, remainder 0) etc. We're running `SELECT COUNT(*) FROM tbl`. I've watched top and I never see more than 8 cores going 100%. Here is my (admittedly ridiculous) postgresql.conf: checkpoint_completion_target = 0.9 data_directory='/tank/postgresql/13/main' default_statistics_target = 100 effective_cache_size = 381696MB effective_io_concurrency = 200 enable_partition_pruning=on enable_partitionwise_aggregate=on enable_partitionwise_join=on listen_addresses='*' maintenance_work_mem = 2GB max_connections = 200 max_parallel_maintenance_workers = 4 max_parallel_workers = 512 max_parallel_workers_per_gather = 512 max_wal_size = 4GB max_worker_processes = 512 min_wal_size = 1GB random_page_cost = 1.1 shared_buffers = 127232MB shared_preload_libraries = 'cstore_fdw' synchronous_commit=off wal_buffers = 16MB work_mem = 1628560kB Best, Seamus -- Seamus Abshere, SCEA https://faraday.ai https://github.com/seamusabshere https://linkedin.com/in/seamusabshere