Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1szfxR-007OjV-P3 for pgsql-general@arkaria.postgresql.org; Sat, 12 Oct 2024 17:31:14 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.94.2) (envelope-from ) id 1szfxO-007S0J-CW for pgsql-general@arkaria.postgresql.org; Sat, 12 Oct 2024 17:31:10 +0000 Received: from makus.postgresql.org ([2001:4800:3e1:1::229]) by malur.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1szfxN-007S0B-VN for pgsql-general@lists.postgresql.org; Sat, 12 Oct 2024 17:31:10 +0000 Received: from shakotay.alphanet.ch ([46.140.72.222]) by makus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1szfxH-000YIR-Cb for pgsql-general@lists.postgresql.org; Sat, 12 Oct 2024 17:31:09 +0000 Received: by shakotay.alphanet.ch (Postfix, from userid 1000) id AA498124444F; Sat, 12 Oct 2024 19:30:58 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=alphanet.ch; s=mail; t=1728754258; bh=ra//2w1Amqukw1OWQT8zht2ssnjzAw+PH8Oz0uZrSU8=; h=Date:From:To:Subject:From; b=K9tHQg1d1MazjyPc0U66lulADYjzu517vUBI+25bMEw/ESS0fApqcHwz3emRMXdxD E5EShbPgLWDM7RReOMCXZVw0u/n4sdyXZ20vcb1EiyII2XjVZzE/52RGqbPr3OnoY2 QbauOyX6sRT9rYyxptyknX4heYthoJewu8D1ZOQuvwn5XwNJqfNbwgldvPEYSHkyIb sfuGHDg+CMuOH+VvZgZ33knetfF28bNpUcVaCH0kjt9MDf0sCWSpwKswNCibwA6hc1 ANQae4ueEC2zAYb6bxwI51T9ApqSiGn9oPDaD8Ay/SrqyJyz90TGk3kMvnCKYTmh3E mB7PUMi2GdLeA== Date: Sat, 12 Oct 2024 19:30:58 +0200 From: Marc SCHAEFER To: pgsql-general@lists.postgresql.org Subject: Naive question about multithreading/multicore Message-ID: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk Hello, on a machine where starting two processes: perl -e 'while (1) { ; }' I see two processed at 100% CPU, which is expected (with top). Now, if I do: template1=> SELECT COUNT(*) FROM pg_class a, pg_class b, pg_class c; I see only one 100% CPU PostgreSQL process. I read that while PostgreSQL connetions lead to a UNIX process model, which is better for isolation, some operations have been parallelized and can use more than one core/thread. Maybe this specific case was not (yet?) parallelized, or should it be and thus something is issing in my configuration? Thank you. PS: psql (13.16 (Debian 13.16-0+deb11u1))