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.96) (envelope-from ) id 1vwba2-000hkx-2o for pgsql-general@arkaria.postgresql.org; Sun, 01 Mar 2026 07:51:11 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.96) (envelope-from ) id 1vwba0-00CZVU-29 for pgsql-general@arkaria.postgresql.org; Sun, 01 Mar 2026 07:51:08 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.96) (envelope-from ) id 1vwba0-00CZVM-0s for pgsql-general@lists.postgresql.org; Sun, 01 Mar 2026 07:51:08 +0000 Received: from mail-yx1-xb134.google.com ([2607:f8b0:4864:20::b134]) by magus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 (Exim 4.98.2) (envelope-from ) id 1vwbZx-00000001qKh-0d5X for pgsql-general@lists.postgresql.org; Sun, 01 Mar 2026 07:51:07 +0000 Received: by mail-yx1-xb134.google.com with SMTP id 956f58d0204a3-64c9a6d6b70so2839995d50.3 for ; Sat, 28 Feb 2026 23:51:05 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1772351464; cv=none; d=google.com; s=arc-20240605; b=MgILlGTGVrHu8DoY5dVWotkmrwdm7FisG1VIB+fVOx0j5D+Iw6BssC3UtE+J5vpWIf yMMX0/TwkRuAPBUJsMw3bcIHRnyXK5YTm5H20odAYqrQE35ZjC499xW2IzbNtRnwehMF r4/KHCACWwfhYw+DPxU4MXB2VHKxSyBBEApuGat+FHHLlyftthzc7wjP6HA6+Zw3hBpH pRU+z06nHYirmU/xKW1Az8HDMr/xiH/MQVYBlSR46qZSPhB9ZJE5EpgQpucaZwFfUJJM M/XMPnpVuN/OEeh75Wm56IHx9RImq2Z8EBlvZUzZEipRSaUjC9t1W6iIpvb2vMaKpf/+ 8GcA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20240605; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:dkim-signature; bh=qB451SLSbh96lDINCRIAvP7vi4b+/oWLDDalDIdd4cE=; fh=kyAsYl77KsxRDd0MpChrI1Mi1G/EXxKHRVc31UaZmY8=; b=HdkUC/naBwJszVLXAP0GxCOBZXxpTr7FxyfwsEN/r8r4slcausGfwx1DJ1qKx02oN4 C9gitbsmSsDKrEEICSXWVLNC/YXtZNBhkWXjT8e2J1teuju99jFSr4Vr62yyQItHxJsq 9s8tEWxBU7XUFpr9VvWyn+kgsEk1S1eGgrjYJO992nu1lHCONnBG1XvlZ5yPoF3xN/zH 1LEGbr/tGlgovfV6LjyAX5w6hULRtAJQDop7npk++/nes5iahk++07Ah/mbJTBMNGjDh A/fRk1sQroEbzhW402B2qwKes9Ve7JICgijElQuO6e2CDLM7BmRFxJH2yvzgY3zSZ0rg lFQg==; darn=lists.postgresql.org ARC-Authentication-Results: i=1; mx.google.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1772351464; x=1772956264; 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=qB451SLSbh96lDINCRIAvP7vi4b+/oWLDDalDIdd4cE=; b=LHXjcvoLsmO+UGbvz2EX4qJprEX+h6PE3TVxj0keqtRf7fdpS4WTHt+jkkmo/QHzx2 M8/0C7EYfC/0/BcIMGZE82OJQqKN2k5bDMAqOYpCr5BCKR/nCHNnsa4JNoyJslDw7Qge BtQLB36t7g84Nyk7S1uJmFGnsvu66m7O1oJlRsg5k9JCm+Z2rmKFYrbjs0ASmyUQjTE2 oInG1PyijSz3VZtob28UR+0kHjKzO4+CF1Jx6MOQjzjPDgclJ5w2yAgMY5Vt3LYWsqp+ 3BQwZlbCIAYVqCF8h5easScSBinCj0t5NWKmrn1YxIS5WZLpmsjnVBYvme62D0Q8U6ME Tn8A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1772351464; x=1772956264; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:x-gm-gg:x-gm-message-state:from :to:cc:subject:date:message-id:reply-to; bh=qB451SLSbh96lDINCRIAvP7vi4b+/oWLDDalDIdd4cE=; b=FLwsjmw5prf0jigHeGR3bcv1Zj8QwpiJdChbG/lygNiS74fHwoCj67byX2QBYeSNI+ 9XYmBeiqD6XNJn+gcie+/WaJ/bqTOl+7Wr0o3o7Na8g8LzYE5xW/8+7oCNUNggIsYBEE wLLq+8CkcHApRLxV7kZxdT/gMvsSGXDocEGP4nZpQnxAJgHkRmhUhaCkQMPvUXMSaTl2 Dj7AOCexiQ86xmVvNyH8hkhJVtiGZWihE7BU8Lu/D4RqngIAGvHl/utsB4rkV4qVYkzs r5LGlbgvhkea6LXkliQ6xvjIjnxHlwnHeJQ0Vy3Hq4+1vvk6/FERI17bvqo3gQxKkD6B yQFQ== X-Gm-Message-State: AOJu0Yw37O71dx3t3xEKszz/ygshXgJp5Vi9PWOoqKCUGibk0KpXHoEp YWC/9xJOX6GSye9GXQh4hIgfuXfKy64hLdkAPca3f6RdJJWARRrrKmkJpmHL7d9kBmf+dwxoG64 BPOMFSkBWZ4cdyUv/DhMVx+/fTnaC6HI= X-Gm-Gg: ATEYQzzwEjzH9pJklGtSab9sTor5tVtUqDm6PYWiwjGd18Q5tS8SYjgAABbWjv70xnC XhBgG+aBvBOxwt3zrYOQVFXSrTM0PkICzNh2ppbXkGib63tcNLYIZqr7eynzR56/cZq99TbWXet 9m8yJdM1qLJQtpJpwbx+V8/peSjK4yR49JjlBtuJEU/spwOzHsFQuUFMqMIulXaJDJqhUj1TdPZ 059PgFpC60pFweuDMBM7Of6N/VT8ogEGqzZjsEw8anmjTDBI7AWuI2gTJbip3gDkqq/1ffyMyrf sMAHrZ+E3hlml2EV/fvB2w== X-Received: by 2002:a53:ece0:0:b0:64a:dcb3:739 with SMTP id 956f58d0204a3-64cc22d5affmr5634096d50.59.1772351463761; Sat, 28 Feb 2026 23:51:03 -0800 (PST) MIME-Version: 1.0 References: In-Reply-To: From: Igor Korot Date: Sun, 1 Mar 2026 01:50:52 -0600 X-Gm-Features: AaiRm51HD-Sszp0-R-2JPLNqjzVNJvX-8A3WbPLF2FFQXxakyqAeSGQbFYCFcOQ Message-ID: Subject: Re: Where the info is stored To: "David G. Johnston" Cc: "pgsql-generallists.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 Hi, David, On Sat, Feb 28, 2026 at 11:49=E2=80=AFPM David G. Johnston wrote: > > On Saturday, February 28, 2026, Igor Korot wrote: >> >> >> draft=3D# WITH idx AS( SELECT i.indexrelid, i.indrelid, i.indnkeyatts, >> i.indkey::int2[] AS indkey FROM pg_index i, pg_class ic, pg_namespace >> ns >> >> >> WHERE ic.oid =3D i.indexrelid AND ns.oid =3D ic.relnamespace AND >> ns.nspname =3D 'public' AND ic.relname =3D 'leagues_new' ) >> >> > > I doubt your index name is leagues_new. That is probably the table name.= But ic.relname contains index names. With some trial and error I think I finally get the query right ;-) draft=3D# SELECT c.relname AS name, ixs.tablespace, -- Get included columns (PostgreSQL 11+) ARRAY( SELECT a.attname FROM pg_attribute a WHERE a.attrelid =3D idx.indrelid AND a.attnum =3D ANY(idx.indkey) AND a.attnum > 0 ORDER BY array_position(idx.indkey, a.attnum) OFFSET idx.indnkeyatts ) AS included, c.reloptions AS storage FROM pg_index idx, pg_class c, pg_namespace n, pg_class t, pg_indexes ixs WHERE ixs.indexname =3D c.relname AND c.oid =3D idx.indexrelid AND t.oid = =3D idx.indrelid AND n.oid =3D c.relnamespace AND idx.indisprimary AND n.nspname =3D 'public' AND t.relname =3D 'leagues_new'; name | tablespace | included | storage ------------------+------------+-------------------------+----------------- leagues_new_pkey | | {drafttype,scoringtype} | {fillfactor=3D50= } (1 row) draft=3D# Thank you for sticking with me and sorry for the trouble. I am getting everything in one DB hit and the query is not that big. I am only worrying about tablespace filtering but I think I got it right. Thx once again. P.S.: If you see any improvement - please by all means do let me know. > > David J.