| BML-S | Help Login

Last entries

    20241002.1421
  1. postgres|postgresql > Administering a Patroni Managed PostgreSQL Cluster - [s]

  2. 20240926.1725
  3. postgres|postgresql > Determining the optimal value for shared_buffers using the pg_buffercache - [s]

    # Also see: https://www.postgresql.org/docs/current/pgbuffercache.html CREATE EXTENSION pg_buffercache; -- identify the top 10 relations residing in shared_buffers and percentage utilisation SELECT c.relname, pg_size_pretty(count(*)*8192) AS buffer_size, pg_size_pretty(pg_relation_size(c.oid)) as relation_size, Round(100.0 * Count(*) / (SELECT setting FROM pg_settings WHERE name = 'shared_buffers') :: INTEGER, 2) AS buffers_percent, ROUND(count(*)*8192*100/ pg_relation_size(c.oid)::numeric, 2 ) AS relation_percent, CASE WHEN c.relkind = 'r' THEN 'table' WHEN c.relkind = 'i' THEN 'index' WHEN c.relkind = 'S' THEN 'sequence' WHEN c.relkind = 't' THEN 'TOAST table' WHEN c.relkind = 'v' THEN 'view' WHEN c.relkind = 'm' THEN 'materialized view' WHEN c.relkind = 'c' THEN 'composite type' WHEN c.relkind = 'f' THEN 'foreign table' WHEN c.relkind = 'p' THEN 'partitioned table' WHEN c.relkind = 'I' THEN 'partitioned index' ELSE 'Unexpected relkind' END as relation_type FROM pg_class c INNER JOIN pg_buffercache b ON b.relfilenode = c.relfilenode INNER JOIN pg_database d ON ( b.reldatabase = d.oid AND d.datname = Current_database() ) GROUP BY c.relname, c.oid ORDER BY pg_total_relation_size(c.oid) DESC LIMIT 10;

  4. 20240923.0904
  5. Testing LDAP Connections With Java | Baeldung - [s]

  6. 20240920.0930
  7. postgres|postgresql > Copy|backup a table including index - [s]

    nxrm94950=# CREATE TABLE search_components_bak (LIKE search_components INCLUDING INDEXES); CREATE TABLE nxrm94950=# INSERT INTO search_components_bak SELECT * FROM search_components; # NOTE: as the names of indexes need to be unique, PostgreSQL seems to change the index names automatically. # Original Indexes: "pk_search_components" PRIMARY KEY, btree (repository_id, component_id, format) "idx_search_components_component_name" btree (search_component_name) "idx_search_components_entity_version" btree (entity_version) ... # Backup Indexes: "search_components_bak_pkey" PRIMARY KEY, btree (repository_id, component_id, format) "search_components_bak_search_component_name_idx" btree (search_component_name) "search_components_bak_entity_version_idx" btree (entity_version) ...

  8. 20240919.0705
  9. postgres|PostgreSQL > error:could not read block * in file "base/*/*": read only * of * bytes - [s]

[s] public (5)