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 1tbeGT-00CG3D-Hw for pgsql-performance@arkaria.postgresql.org; Sat, 25 Jan 2025 11:23:49 +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 1tbeGS-002G9T-NL for pgsql-performance@arkaria.postgresql.org; Sat, 25 Jan 2025 11:23:48 +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 1tbeGS-002G9K-C1 for pgsql-performance@lists.postgresql.org; Sat, 25 Jan 2025 11:23:48 +0000 Received: from mail-ed1-x52b.google.com ([2a00:1450:4864:20::52b]) by makus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 (Exim 4.96) (envelope-from ) id 1tbeGP-001Qco-28 for pgsql-performance@lists.postgresql.org; Sat, 25 Jan 2025 11:23:47 +0000 Received: by mail-ed1-x52b.google.com with SMTP id 4fb4d7f45d1cf-5d3f57582a2so8464656a12.1 for ; Sat, 25 Jan 2025 03:23:45 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1737804224; x=1738409024; darn=lists.postgresql.org; h=to:date:message-id:subject:mime-version:from:from:to:cc:subject :date:message-id:reply-to; bh=zqVPohT0NHbNuZS+Fc9mgVjMUs8yg42XcmVLwElEVn4=; b=gnx57GM8wxMo5hLQkaUl23PhfHdQf7QOnhuNKlNgcsTLZ3HPItXL2lIvAQETvQjNfh JhJcirhOiy+am2JfaYKUMPcAKXc9OHO5FEMAqunaNUPbDivdoOiAD+Ch+5sfNZ4DVQcN eMAvpubJh7mWtq6J70pqbazuc2Z5QbIlGSp2WpU6todNh3Onh4QOtYZ5uahqKKfX5hYE K9ull8p/vX3p5EMMjdcDDV5Rd6Uqa+RNwkXgkPAo8TQUfRQlUyRtKxEl+P5K82OivPJs J7j2w8Ab122toDam1W1aWJj8dn3gB6mTyJiAs3TQgi6iECs7VzwIGUTH8X2v23Vm5IXh xPeQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1737804224; x=1738409024; h=to:date:message-id:subject:mime-version:from:x-gm-message-state :from:to:cc:subject:date:message-id:reply-to; bh=zqVPohT0NHbNuZS+Fc9mgVjMUs8yg42XcmVLwElEVn4=; b=a5vvBJthWMKN4cNFKup7XlGTh+swArhVASOEVqmXQFnI7xKldVwjjpRIA1dG19DH69 9DbSAE2Bc3KIWqD+Wqy41ZUUbkGFLDa+czppItxIVbiqOrw96m/jIb8lpeZ7J7vAS8Df yLsJyQyhsmRM5Lg0dMMgsb2+g3IMi34QD6+tX14hOuS/fRnw84HNEpGhlhjgRQZ14W5G rQtRp0tiZ1iVmS6GmboCwey819AfHxqTPcxCiNo67atwRLpPImYV/bN5jQVeOAq29XeL J1lEynKpAgl0dWdobnw+V79+2ZOMv1j7rzzdW2T/oNIXk6WbdrwPDKEuS9UJr+zmoO/G N/IA== X-Gm-Message-State: AOJu0YxoJ9T2ezNMBA3C9xm9eWCm81XO+T/pMKblfqCPgcQBwLgzIN6E b2askq4MDHVHaQSMPj035LUgcLyTNdlWdv2NbNJRF70Ku71e70MafgHJZv1ENO0= X-Gm-Gg: ASbGnctrDd9W9hnIiyw6rgMMz8OAqu6xHD1bOcpBuIs5dgop0Jzxzj4EYHmaezg97YH fODf18CY0jt4gr7xF8sss36yox0JWcFgyE8+34B40ktvcQbdgnB5D5x427RZLTQgBiq6EvTmcAD OQ9+06n95oA4KsU7FASTYiEZpWcKOb8uA8VY7GPNcTNeZyK7ZwPCGX1GNSxCteW3jGRrgT1XSSd nSDhbicUB1+J3G+NccY7UuUJc6XHn8+ej5FYkwYQFPSuq6ZLNlxNl4sL8Xtt+ceVSSdVJkI9SU1 eLioa6NPe0KS1385N9SVnXTssCGMAxjAG9j6H9v0x0x+Zj27rBqMojVfnhAe6SLH71+dnpHvb2D yJ5Cvi97WlQo9wcrmXvyjEBA2RvaR3+iZmii72tDa X-Google-Smtp-Source: AGHT+IHdmxFYvN2jxRuSwDZUO66n7+WFw1pTIEML7S7kGvhXUTaZemocE2QjiSBFDA/REgxaMoXlnA== X-Received: by 2002:a17:907:3604:b0:ab3:8f33:408a with SMTP id a640c23a62f3a-ab67466fb1dmr712873666b.19.1737804224077; Sat, 25 Jan 2025 03:23:44 -0800 (PST) Received: from smtpclient.apple (2001-1c04-0681-7700-a50d-7275-da0b-78f3.cable.dynamic.v6.ziggo.nl. [2001:1c04:681:7700:a50d:7275:da0b:78f3]) by smtp.gmail.com with ESMTPSA id a640c23a62f3a-ab6760fb3f7sm272306766b.138.2025.01.25.03.23.42 for (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Sat, 25 Jan 2025 03:23:43 -0800 (PST) From: Frits Hoogland Content-Type: multipart/alternative; boundary="Apple-Mail=_AAF48DB1-196D-464F-B2C6-FE78AEE4579F" Mime-Version: 1.0 (Mac OS X Mail 16.0 \(3826.300.87.4.3\)) Subject: Any risk or overhead considerations for frequently executing queries against catalog tables? Message-Id: Date: Sat, 25 Jan 2025 12:23:32 +0100 To: pgsql-performance@lists.postgresql.org X-Mailer: Apple Mail (2.3826.300.87.4.3) List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk --Apple-Mail=_AAF48DB1-196D-464F-B2C6-FE78AEE4579F Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset=us-ascii For monitoring database behaviour and trying to build an history of = activity, if I would create an application that creates a single = connection and execute something like: select * from pg_stat_activity; select * from pg_stat_database; select * from pg_stat_bgwriter; select * from pg_stat_wal; select * from pg_settings; select * from pg_database; For which the query is prepared, and execute that every 1 second, would = there be any realistic danger or overhead that should be considered? My thinking is that the data for these catalogs are all in shared memory = and when executed serially and do not cause any significant resources to = be taken? Thanks, Frits Hoogland --Apple-Mail=_AAF48DB1-196D-464F-B2C6-FE78AEE4579F Content-Transfer-Encoding: 7bit Content-Type: text/html; charset=us-ascii For monitoring database behaviour and trying to build an history of activity, if I would create an application that creates a single connection and execute something like:
select * from pg_stat_activity;
select * from pg_stat_database;
select * from pg_stat_bgwriter;
select * from pg_stat_wal;
select * from pg_settings;
select * from pg_database;
For which the query is prepared, and execute that every 1 second, would there be any realistic danger or overhead that should be considered?
My thinking is that the data for these catalogs are all in shared memory and when executed serially and do not cause any significant resources to be taken?

Thanks,

Frits Hoogland




--Apple-Mail=_AAF48DB1-196D-464F-B2C6-FE78AEE4579F--