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 1qfioA-00CrsP-Iu for psycopg@arkaria.postgresql.org; Mon, 11 Sep 2023 15:26:38 +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 1qfio9-001Mfs-8T for psycopg@arkaria.postgresql.org; Mon, 11 Sep 2023 15:26:37 +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 1qfio9-001Mfa-0k for psycopg@lists.postgresql.org; Mon, 11 Sep 2023 15:26:36 +0000 Received: from mail-oa1-x2d.google.com ([2001:4860:4864:20::2d]) by makus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 (Exim 4.94.2) (envelope-from ) id 1qfio5-003z3l-U3 for psycopg@postgresql.org; Mon, 11 Sep 2023 15:26:35 +0000 Received: by mail-oa1-x2d.google.com with SMTP id 586e51a60fabf-1d5c54160a8so531944fac.0 for ; Mon, 11 Sep 2023 08:26:33 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20221208; t=1694445993; x=1695050793; darn=postgresql.org; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:from:to:cc:subject:date:message-id:reply-to; bh=wqW5zWs7CmqJ46zPyJ8iFzFG1M94s5mqkvauCj7gC3g=; b=L1P1EJmQ30F0aN4a5I3ySAp+7hlfhaZvS6X9sXj+VZi8aZfobo2K98JuZbhahVlUX3 bmU7lPbg+XM2BSdq1/3O0xnVvLkRwbq329XCdNlZmQ/QG1+pASKXJtW6CxFRFRiU7uOq glD8xz3lZ8lBO8QVmCHn3a1xnBdJIqkV9TD9B9jTw0Xwy/9PjTr3noPF95xnNC4UrBiD ovHl+3V6zwe3FvwE3fAAYM+w0ewDl2TYys1cdeizSGspj+dxZsjeFZgTFn/7dZxXNRUX EAfOC+ztqKLmFGBaa/ZsLSU6T40zgk69pbVvGYiufWGhIs+BulZu1BrtMhwNes1UYQs+ 0xIw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1694445993; x=1695050793; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=wqW5zWs7CmqJ46zPyJ8iFzFG1M94s5mqkvauCj7gC3g=; b=HDBMmfpfjymeS6s5gKT33ZPnasapztmso52HMtQpyw+SG9QJuQG82bk/B2UqWJibRZ qrocDFn+mfSeIKyM9nkrtuukgr56lUPLBXRaOQeKpGU2it/pf34EhY0S9Qt/Fqi/ijrn AVB7LwS2LK/R03Q0mjISZpfKpyEp8tQedvCEjFieTf4VlNDV+KL2qlVar16MjHPI6HeB VtEGx4vTSh0BgPMTUaIMNa9f2tBLGTeFhVqq2+RBAzpl6xzDvq52m9a3To3eFkod+OQa yhXSbpoz/mfjcTVX9Y6oSbN7PBbgmkMBadB9cg8GT2phNfATfiFtyTcL8/m3CrE2iwO8 SBlg== X-Gm-Message-State: AOJu0YyUjWmR+wO4oZ+j8vKWG8xZv1DWljoWwAqE4P+DuYicNacvBxs5 HLWS0uVpebmUaJIEtfbJGqyamhjlbfcPqyLZTLVlpDX2xe8= X-Google-Smtp-Source: AGHT+IHKBcjwL8bUe23y8YRX/KSzku/nJmLGKymlVpHGzkOUw69Hm1RS9UneTp4PYg1tafZ5jloJe8RmpvVJXuog0oE= X-Received: by 2002:a05:6870:e15:b0:1d5:8f05:39da with SMTP id mp21-20020a0568700e1500b001d58f0539damr5553925oab.25.1694445993181; Mon, 11 Sep 2023 08:26:33 -0700 (PDT) MIME-Version: 1.0 References: In-Reply-To: From: Daniele Varrazzo Date: Mon, 11 Sep 2023 16:26:21 +0100 Message-ID: Subject: Re: CPU usage for queries, psycopg 2 vs 3 To: David Raymond Cc: "psycopg@postgresql.org" Content-Type: text/plain; charset="UTF-8" List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk Hello David, On Tue, 5 Sept 2023 at 18:52, David Raymond wrote: > > I've noticed that CPU usage for queries seems to have drastically increased going from psycopg2 to psycopg3. > [...] > This is on Windows, where I install with "pip install psycopg2-binary" and "pip install psycopg[binary]" I have tested your script on Linux and on this platform I can't reproduce the issue. Psycopg 3 CPU usage remains low. I will try to repeat your test on Windows. -- Daniele