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 1s7CjY-004JAu-Eg for pgsql-general@arkaria.postgresql.org; Wed, 15 May 2024 11:23:45 +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 1s7CjX-00EW3e-W7 for pgsql-general@arkaria.postgresql.org; Wed, 15 May 2024 11:23:43 +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 1s7CjX-00EW3I-LM for pgsql-general@lists.postgresql.org; Wed, 15 May 2024 11:23:43 +0000 Received: from mail-lf1-x135.google.com ([2a00:1450:4864:20::135]) by makus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 (Exim 4.94.2) (envelope-from ) id 1s7CjV-000K7y-Ec for pgsql-general@lists.postgresql.org; Wed, 15 May 2024 11:23:42 +0000 Received: by mail-lf1-x135.google.com with SMTP id 2adb3069b0e04-52327368e59so4083532e87.1 for ; Wed, 15 May 2024 04:23:41 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1715772220; x=1716377020; darn=lists.postgresql.org; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:from:to:cc:subject:date :message-id:reply-to; bh=q8nNAlxuox3uBjkgFNYGQkmACHoO42MRdzWz0sqWCkg=; b=VCeXFbEJCP74ZEO/Fw+bAqR3kpTabadyb4zHU8Qlb+eJlWUJSpIf8uuxAj88O8o9y9 R/KXAoCyLmXuDquZrqND4mYvCiBnB2mfer6vITlXbB/gzlebU+CIoUXCfS85lKqevYXU PwLxq1MF1JUB6KGL65JeWbOePZtRtjLfjyahSkg6bGiVNDCr6XbuOoDB7J1lqrqvWFh2 4mPY9j3I8DrO5bM+17YKwVIALa1PckQGQZN8ubjIXOb7FcM9b2TdmyE+55hO3WjpwS2P mBzo+S7XNkshMbAvmi4SjZafugEj84huQ/wCjxI90DqZ23mexmu+ITCO1dg03FfSjy9C ChuQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1715772220; x=1716377020; h=content-transfer-encoding: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=q8nNAlxuox3uBjkgFNYGQkmACHoO42MRdzWz0sqWCkg=; b=pN96sV8U0xhkxKSNbnB5Cm6ghEgY3lP7LlKt0w4pzboAbo3vBgE1YUVb2n3W1t/pNp aIAEkjNmewGDNMJgFF6R/Cg8VrWs/BS0bpYmUP9osRkvvuQMi34MwLyHF+sOXFv8+O+L HCUTlxYtpUrVsLs0p+QRzvp6p6LMoKuVJZmR5SK8ggDc3ytTC7ZBdITf6WjHK1czIZg2 tXUF2XThVNQ5TOrVajEJTR1sXFVbFYAY5I/SyGZhcYiiy5gfgmwhgyCHmUXj+xauHET+ bhQ5qXWPAfaEyKU050aAgJYMXjfT6zr8IGosK/ts/thLRkzfEjbWwCE/A/JcR9bTBRbh oLjQ== X-Gm-Message-State: AOJu0YwJm8drxI5I6bjvUUhPPkRkzrJkGL+Pwb3KKVQgz8rVi4Zm4roJ SXjoypbVU+KnB7H30ahg/9gsPdn4fnoGmjU+l2eLEWYVFtIyKlYlSy/Mp1DuuU7SfNsClU8NKyB 87oNeGfhMolVAhjAOjvralmfv2Oo= X-Google-Smtp-Source: AGHT+IFgZduEzPIQayJj5jAKgHSjVnVinzzpr+nYpLnrOfQg/J37XLIpKat8/80h7lCHydGwL7ZDws2YvXHG/JRYmy0= X-Received: by 2002:ac2:54b9:0:b0:51f:d72:cd2d with SMTP id 2adb3069b0e04-5220fc7aeb4mr9551252e87.22.1715772219680; Wed, 15 May 2024 04:23:39 -0700 (PDT) MIME-Version: 1.0 References: In-Reply-To: From: David Rowley Date: Wed, 15 May 2024 23:23:27 +1200 Message-ID: Subject: Re: problem with query To: =?UTF-8?B?U2HFoW8gR2FudGFy?= Cc: pgsql-general@lists.postgresql.org Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk On Wed, 15 May 2024 at 21:08, Sa=C5=A1o Gantar wrote: > this query takes more than 8 seconds, > if i remove "AND ((pgn.nspname=3D'servicedesk'))" and test it, it takes <= 1s Including the EXPLAIN rather than EXPLAIN (ANALYZE, BUFFERS) isn't very useful as there's no way to tell if the planner's estimates were accurate or not. Also with EXPLAIN only, we don't know where the time was spent in the query. Running the EXPLAIN with "SET track_io_timing =3D 1;" would be even more us= eful. David