All locks
Queries with active locks
Queries with active locks
| Pid | Relname | Transactionid | Granted | Query snippet | Mode | Age |
|---|---|---|---|---|---|---|
| 2509887 | oban_jobs_state_queue_priority_scheduled_at_id_index | true | SELECT o0."id", o0."args", o0."attempt", o0."attempted_by", o0."worker", o0."queue", o0."max_attempts", o0."meta", o0."state", o0."inserted_at", o0."attempted_at", o0."cancelled_at", o0."completed_at", o0."discarded_at", o0."scheduled_at" FROM "public"."oban_jobs" AS o0 WHERE (($1 AND (o0."state" = $2)) AND o0."queue" = ANY($3)) ORDER BY o0."scheduled_at" LIMIT $4 | AccessShareLock | 0.043318 seconds | |
| 2509887 | oban_jobs | true | SELECT o0."id", o0."args", o0."attempt", o0."attempted_by", o0."worker", o0."queue", o0."max_attempts", o0."meta", o0."state", o0."inserted_at", o0."attempted_at", o0."cancelled_at", o0."completed_at", o0."discarded_at", o0."scheduled_at" FROM "public"."oban_jobs" AS o0 WHERE (($1 AND (o0."state" = $2)) AND o0."queue" = ANY($3)) ORDER BY o0."scheduled_at" LIMIT $4 | AccessShareLock | 0.043318 seconds | |
| 2509887 | true | SELECT o0."id", o0."args", o0."attempt", o0."attempted_by", o0."worker", o0."queue", o0."max_attempts", o0."meta", o0."state", o0."inserted_at", o0."attempted_at", o0."cancelled_at", o0."completed_at", o0."discarded_at", o0."scheduled_at" FROM "public"."oban_jobs" AS o0 WHERE (($1 AND (o0."state" = $2)) AND o0."queue" = ANY($3)) ORDER BY o0."scheduled_at" LIMIT $4 | ExclusiveLock | 0.043318 seconds | ||
| 2509887 | oban_jobs_pkey | true | SELECT o0."id", o0."args", o0."attempt", o0."attempted_by", o0."worker", o0."queue", o0."max_attempts", o0."meta", o0."state", o0."inserted_at", o0."attempted_at", o0."cancelled_at", o0."completed_at", o0."discarded_at", o0."scheduled_at" FROM "public"."oban_jobs" AS o0 WHERE (($1 AND (o0."state" = $2)) AND o0."queue" = ANY($3)) ORDER BY o0."scheduled_at" LIMIT $4 | AccessShareLock | 0.043318 seconds | |
| 2509887 | oban_jobs_args_index | true | SELECT o0."id", o0."args", o0."attempt", o0."attempted_by", o0."worker", o0."queue", o0."max_attempts", o0."meta", o0."state", o0."inserted_at", o0."attempted_at", o0."cancelled_at", o0."completed_at", o0."discarded_at", o0."scheduled_at" FROM "public"."oban_jobs" AS o0 WHERE (($1 AND (o0."state" = $2)) AND o0."queue" = ANY($3)) ORDER BY o0."scheduled_at" LIMIT $4 | AccessShareLock | 0.043318 seconds | |
| 2509887 | oban_jobs_meta_index | true | SELECT o0."id", o0."args", o0."attempt", o0."attempted_by", o0."worker", o0."queue", o0."max_attempts", o0."meta", o0."state", o0."inserted_at", o0."attempted_at", o0."cancelled_at", o0."completed_at", o0."discarded_at", o0."scheduled_at" FROM "public"."oban_jobs" AS o0 WHERE (($1 AND (o0."state" = $2)) AND o0."queue" = ANY($3)) ORDER BY o0."scheduled_at" LIMIT $4 | AccessShareLock | 0.043318 seconds | |
| 2493520 | pg_index_indrelid_index | true | /* ECTO_PSQL_EXTRAS: Find indexes with a high ratio of NULL values */ SELECT c.oid, c.relname AS index, pg_size_pretty(pg_relation_size(c.oid)) AS index_size, i.indisunique AS unique, a.attname AS indexed_column, CASE s.null_frac WHEN 0 THEN '' ELSE to_char(s.null_frac * 100, '999.00%') END AS null_frac, pg_size_pretty((pg_relation_size(c.oid) * s.null_frac)::bigint) AS expected_saving FROM pg_class c JOIN pg_index i ON i.indexrelid = c.oid JOIN pg_attribute a ON a.attrelid = c.oid JOIN pg_class c_table ON c_table.oid = i.indrelid JOIN pg_indexes ixs ON c.relname = ixs.indexname LEFT JOIN pg_stats s ON s.tablename = c_table.relname AND a.attname = s.attname WHERE -- Primary key cannot be partial NOT i.indisprimary -- Exclude already partial indexes AND i.indpred IS NULL -- Exclude composite indexes AND array_length(i.indkey, 1) = 1 -- Exclude indexes without null_frac ratio AND coalesce(s.null_frac, 0) != | AccessShareLock | 0.0-5400 seconds | |
| 2493520 | pg_class_oid_index | true | /* ECTO_PSQL_EXTRAS: Find indexes with a high ratio of NULL values */ SELECT c.oid, c.relname AS index, pg_size_pretty(pg_relation_size(c.oid)) AS index_size, i.indisunique AS unique, a.attname AS indexed_column, CASE s.null_frac WHEN 0 THEN '' ELSE to_char(s.null_frac * 100, '999.00%') END AS null_frac, pg_size_pretty((pg_relation_size(c.oid) * s.null_frac)::bigint) AS expected_saving FROM pg_class c JOIN pg_index i ON i.indexrelid = c.oid JOIN pg_attribute a ON a.attrelid = c.oid JOIN pg_class c_table ON c_table.oid = i.indrelid JOIN pg_indexes ixs ON c.relname = ixs.indexname LEFT JOIN pg_stats s ON s.tablename = c_table.relname AND a.attname = s.attname WHERE -- Primary key cannot be partial NOT i.indisprimary -- Exclude already partial indexes AND i.indpred IS NULL -- Exclude composite indexes AND array_length(i.indkey, 1) = 1 -- Exclude indexes without null_frac ratio AND coalesce(s.null_frac, 0) != | AccessShareLock | 0.0-5400 seconds | |
| 2493520 | pg_index | true | /* ECTO_PSQL_EXTRAS: Find indexes with a high ratio of NULL values */ SELECT c.oid, c.relname AS index, pg_size_pretty(pg_relation_size(c.oid)) AS index_size, i.indisunique AS unique, a.attname AS indexed_column, CASE s.null_frac WHEN 0 THEN '' ELSE to_char(s.null_frac * 100, '999.00%') END AS null_frac, pg_size_pretty((pg_relation_size(c.oid) * s.null_frac)::bigint) AS expected_saving FROM pg_class c JOIN pg_index i ON i.indexrelid = c.oid JOIN pg_attribute a ON a.attrelid = c.oid JOIN pg_class c_table ON c_table.oid = i.indrelid JOIN pg_indexes ixs ON c.relname = ixs.indexname LEFT JOIN pg_stats s ON s.tablename = c_table.relname AND a.attname = s.attname WHERE -- Primary key cannot be partial NOT i.indisprimary -- Exclude already partial indexes AND i.indpred IS NULL -- Exclude composite indexes AND array_length(i.indkey, 1) = 1 -- Exclude indexes without null_frac ratio AND coalesce(s.null_frac, 0) != | AccessShareLock | 0.0-5400 seconds | |
| 2493520 | pg_attribute_relid_attnum_index | true | /* ECTO_PSQL_EXTRAS: Find indexes with a high ratio of NULL values */ SELECT c.oid, c.relname AS index, pg_size_pretty(pg_relation_size(c.oid)) AS index_size, i.indisunique AS unique, a.attname AS indexed_column, CASE s.null_frac WHEN 0 THEN '' ELSE to_char(s.null_frac * 100, '999.00%') END AS null_frac, pg_size_pretty((pg_relation_size(c.oid) * s.null_frac)::bigint) AS expected_saving FROM pg_class c JOIN pg_index i ON i.indexrelid = c.oid JOIN pg_attribute a ON a.attrelid = c.oid JOIN pg_class c_table ON c_table.oid = i.indrelid JOIN pg_indexes ixs ON c.relname = ixs.indexname LEFT JOIN pg_stats s ON s.tablename = c_table.relname AND a.attname = s.attname WHERE -- Primary key cannot be partial NOT i.indisprimary -- Exclude already partial indexes AND i.indpred IS NULL -- Exclude composite indexes AND array_length(i.indkey, 1) = 1 -- Exclude indexes without null_frac ratio AND coalesce(s.null_frac, 0) != | AccessShareLock | 0.0-5400 seconds | |
| 2493520 | pg_index_indexrelid_index | true | /* ECTO_PSQL_EXTRAS: Find indexes with a high ratio of NULL values */ SELECT c.oid, c.relname AS index, pg_size_pretty(pg_relation_size(c.oid)) AS index_size, i.indisunique AS unique, a.attname AS indexed_column, CASE s.null_frac WHEN 0 THEN '' ELSE to_char(s.null_frac * 100, '999.00%') END AS null_frac, pg_size_pretty((pg_relation_size(c.oid) * s.null_frac)::bigint) AS expected_saving FROM pg_class c JOIN pg_index i ON i.indexrelid = c.oid JOIN pg_attribute a ON a.attrelid = c.oid JOIN pg_class c_table ON c_table.oid = i.indrelid JOIN pg_indexes ixs ON c.relname = ixs.indexname LEFT JOIN pg_stats s ON s.tablename = c_table.relname AND a.attname = s.attname WHERE -- Primary key cannot be partial NOT i.indisprimary -- Exclude already partial indexes AND i.indpred IS NULL -- Exclude composite indexes AND array_length(i.indkey, 1) = 1 -- Exclude indexes without null_frac ratio AND coalesce(s.null_frac, 0) != | AccessShareLock | 0.0-5400 seconds | |
| 2493520 | pg_class_tblspc_relfilenode_index | true | /* ECTO_PSQL_EXTRAS: Find indexes with a high ratio of NULL values */ SELECT c.oid, c.relname AS index, pg_size_pretty(pg_relation_size(c.oid)) AS index_size, i.indisunique AS unique, a.attname AS indexed_column, CASE s.null_frac WHEN 0 THEN '' ELSE to_char(s.null_frac * 100, '999.00%') END AS null_frac, pg_size_pretty((pg_relation_size(c.oid) * s.null_frac)::bigint) AS expected_saving FROM pg_class c JOIN pg_index i ON i.indexrelid = c.oid JOIN pg_attribute a ON a.attrelid = c.oid JOIN pg_class c_table ON c_table.oid = i.indrelid JOIN pg_indexes ixs ON c.relname = ixs.indexname LEFT JOIN pg_stats s ON s.tablename = c_table.relname AND a.attname = s.attname WHERE -- Primary key cannot be partial NOT i.indisprimary -- Exclude already partial indexes AND i.indpred IS NULL -- Exclude composite indexes AND array_length(i.indkey, 1) = 1 -- Exclude indexes without null_frac ratio AND coalesce(s.null_frac, 0) != | AccessShareLock | 0.0-5400 seconds | |
| 2493520 | pg_class_relname_nsp_index | true | /* ECTO_PSQL_EXTRAS: Find indexes with a high ratio of NULL values */ SELECT c.oid, c.relname AS index, pg_size_pretty(pg_relation_size(c.oid)) AS index_size, i.indisunique AS unique, a.attname AS indexed_column, CASE s.null_frac WHEN 0 THEN '' ELSE to_char(s.null_frac * 100, '999.00%') END AS null_frac, pg_size_pretty((pg_relation_size(c.oid) * s.null_frac)::bigint) AS expected_saving FROM pg_class c JOIN pg_index i ON i.indexrelid = c.oid JOIN pg_attribute a ON a.attrelid = c.oid JOIN pg_class c_table ON c_table.oid = i.indrelid JOIN pg_indexes ixs ON c.relname = ixs.indexname LEFT JOIN pg_stats s ON s.tablename = c_table.relname AND a.attname = s.attname WHERE -- Primary key cannot be partial NOT i.indisprimary -- Exclude already partial indexes AND i.indpred IS NULL -- Exclude composite indexes AND array_length(i.indkey, 1) = 1 -- Exclude indexes without null_frac ratio AND coalesce(s.null_frac, 0) != | AccessShareLock | 0.0-5400 seconds | |
| 2493520 | pg_statistic | true | /* ECTO_PSQL_EXTRAS: Find indexes with a high ratio of NULL values */ SELECT c.oid, c.relname AS index, pg_size_pretty(pg_relation_size(c.oid)) AS index_size, i.indisunique AS unique, a.attname AS indexed_column, CASE s.null_frac WHEN 0 THEN '' ELSE to_char(s.null_frac * 100, '999.00%') END AS null_frac, pg_size_pretty((pg_relation_size(c.oid) * s.null_frac)::bigint) AS expected_saving FROM pg_class c JOIN pg_index i ON i.indexrelid = c.oid JOIN pg_attribute a ON a.attrelid = c.oid JOIN pg_class c_table ON c_table.oid = i.indrelid JOIN pg_indexes ixs ON c.relname = ixs.indexname LEFT JOIN pg_stats s ON s.tablename = c_table.relname AND a.attname = s.attname WHERE -- Primary key cannot be partial NOT i.indisprimary -- Exclude already partial indexes AND i.indpred IS NULL -- Exclude composite indexes AND array_length(i.indkey, 1) = 1 -- Exclude indexes without null_frac ratio AND coalesce(s.null_frac, 0) != | AccessShareLock | 0.0-5400 seconds | |
| 2493520 | pg_namespace | true | /* ECTO_PSQL_EXTRAS: Find indexes with a high ratio of NULL values */ SELECT c.oid, c.relname AS index, pg_size_pretty(pg_relation_size(c.oid)) AS index_size, i.indisunique AS unique, a.attname AS indexed_column, CASE s.null_frac WHEN 0 THEN '' ELSE to_char(s.null_frac * 100, '999.00%') END AS null_frac, pg_size_pretty((pg_relation_size(c.oid) * s.null_frac)::bigint) AS expected_saving FROM pg_class c JOIN pg_index i ON i.indexrelid = c.oid JOIN pg_attribute a ON a.attrelid = c.oid JOIN pg_class c_table ON c_table.oid = i.indrelid JOIN pg_indexes ixs ON c.relname = ixs.indexname LEFT JOIN pg_stats s ON s.tablename = c_table.relname AND a.attname = s.attname WHERE -- Primary key cannot be partial NOT i.indisprimary -- Exclude already partial indexes AND i.indpred IS NULL -- Exclude composite indexes AND array_length(i.indkey, 1) = 1 -- Exclude indexes without null_frac ratio AND coalesce(s.null_frac, 0) != | AccessShareLock | 0.0-5400 seconds | |
| 2493520 | pg_indexes | true | /* ECTO_PSQL_EXTRAS: Find indexes with a high ratio of NULL values */ SELECT c.oid, c.relname AS index, pg_size_pretty(pg_relation_size(c.oid)) AS index_size, i.indisunique AS unique, a.attname AS indexed_column, CASE s.null_frac WHEN 0 THEN '' ELSE to_char(s.null_frac * 100, '999.00%') END AS null_frac, pg_size_pretty((pg_relation_size(c.oid) * s.null_frac)::bigint) AS expected_saving FROM pg_class c JOIN pg_index i ON i.indexrelid = c.oid JOIN pg_attribute a ON a.attrelid = c.oid JOIN pg_class c_table ON c_table.oid = i.indrelid JOIN pg_indexes ixs ON c.relname = ixs.indexname LEFT JOIN pg_stats s ON s.tablename = c_table.relname AND a.attname = s.attname WHERE -- Primary key cannot be partial NOT i.indisprimary -- Exclude already partial indexes AND i.indpred IS NULL -- Exclude composite indexes AND array_length(i.indkey, 1) = 1 -- Exclude indexes without null_frac ratio AND coalesce(s.null_frac, 0) != | AccessShareLock | 0.0-5400 seconds | |
| 2493520 | pg_class | true | /* ECTO_PSQL_EXTRAS: Find indexes with a high ratio of NULL values */ SELECT c.oid, c.relname AS index, pg_size_pretty(pg_relation_size(c.oid)) AS index_size, i.indisunique AS unique, a.attname AS indexed_column, CASE s.null_frac WHEN 0 THEN '' ELSE to_char(s.null_frac * 100, '999.00%') END AS null_frac, pg_size_pretty((pg_relation_size(c.oid) * s.null_frac)::bigint) AS expected_saving FROM pg_class c JOIN pg_index i ON i.indexrelid = c.oid JOIN pg_attribute a ON a.attrelid = c.oid JOIN pg_class c_table ON c_table.oid = i.indrelid JOIN pg_indexes ixs ON c.relname = ixs.indexname LEFT JOIN pg_stats s ON s.tablename = c_table.relname AND a.attname = s.attname WHERE -- Primary key cannot be partial NOT i.indisprimary -- Exclude already partial indexes AND i.indpred IS NULL -- Exclude composite indexes AND array_length(i.indkey, 1) = 1 -- Exclude indexes without null_frac ratio AND coalesce(s.null_frac, 0) != | AccessShareLock | 0.0-5400 seconds | |
| 2493520 | true | /* ECTO_PSQL_EXTRAS: Find indexes with a high ratio of NULL values */ SELECT c.oid, c.relname AS index, pg_size_pretty(pg_relation_size(c.oid)) AS index_size, i.indisunique AS unique, a.attname AS indexed_column, CASE s.null_frac WHEN 0 THEN '' ELSE to_char(s.null_frac * 100, '999.00%') END AS null_frac, pg_size_pretty((pg_relation_size(c.oid) * s.null_frac)::bigint) AS expected_saving FROM pg_class c JOIN pg_index i ON i.indexrelid = c.oid JOIN pg_attribute a ON a.attrelid = c.oid JOIN pg_class c_table ON c_table.oid = i.indrelid JOIN pg_indexes ixs ON c.relname = ixs.indexname LEFT JOIN pg_stats s ON s.tablename = c_table.relname AND a.attname = s.attname WHERE -- Primary key cannot be partial NOT i.indisprimary -- Exclude already partial indexes AND i.indpred IS NULL -- Exclude composite indexes AND array_length(i.indkey, 1) = 1 -- Exclude indexes without null_frac ratio AND coalesce(s.null_frac, 0) != | ExclusiveLock | 0.0-5400 seconds | ||
| 2493520 | pg_tablespace | true | /* ECTO_PSQL_EXTRAS: Find indexes with a high ratio of NULL values */ SELECT c.oid, c.relname AS index, pg_size_pretty(pg_relation_size(c.oid)) AS index_size, i.indisunique AS unique, a.attname AS indexed_column, CASE s.null_frac WHEN 0 THEN '' ELSE to_char(s.null_frac * 100, '999.00%') END AS null_frac, pg_size_pretty((pg_relation_size(c.oid) * s.null_frac)::bigint) AS expected_saving FROM pg_class c JOIN pg_index i ON i.indexrelid = c.oid JOIN pg_attribute a ON a.attrelid = c.oid JOIN pg_class c_table ON c_table.oid = i.indrelid JOIN pg_indexes ixs ON c.relname = ixs.indexname LEFT JOIN pg_stats s ON s.tablename = c_table.relname AND a.attname = s.attname WHERE -- Primary key cannot be partial NOT i.indisprimary -- Exclude already partial indexes AND i.indpred IS NULL -- Exclude composite indexes AND array_length(i.indkey, 1) = 1 -- Exclude indexes without null_frac ratio AND coalesce(s.null_frac, 0) != | AccessShareLock | 0.0-5400 seconds | |
| 2493520 | pg_tablespace_oid_index | true | /* ECTO_PSQL_EXTRAS: Find indexes with a high ratio of NULL values */ SELECT c.oid, c.relname AS index, pg_size_pretty(pg_relation_size(c.oid)) AS index_size, i.indisunique AS unique, a.attname AS indexed_column, CASE s.null_frac WHEN 0 THEN '' ELSE to_char(s.null_frac * 100, '999.00%') END AS null_frac, pg_size_pretty((pg_relation_size(c.oid) * s.null_frac)::bigint) AS expected_saving FROM pg_class c JOIN pg_index i ON i.indexrelid = c.oid JOIN pg_attribute a ON a.attrelid = c.oid JOIN pg_class c_table ON c_table.oid = i.indrelid JOIN pg_indexes ixs ON c.relname = ixs.indexname LEFT JOIN pg_stats s ON s.tablename = c_table.relname AND a.attname = s.attname WHERE -- Primary key cannot be partial NOT i.indisprimary -- Exclude already partial indexes AND i.indpred IS NULL -- Exclude composite indexes AND array_length(i.indkey, 1) = 1 -- Exclude indexes without null_frac ratio AND coalesce(s.null_frac, 0) != | AccessShareLock | 0.0-5400 seconds | |
| 2493520 | pg_statistic_relid_att_inh_index | true | /* ECTO_PSQL_EXTRAS: Find indexes with a high ratio of NULL values */ SELECT c.oid, c.relname AS index, pg_size_pretty(pg_relation_size(c.oid)) AS index_size, i.indisunique AS unique, a.attname AS indexed_column, CASE s.null_frac WHEN 0 THEN '' ELSE to_char(s.null_frac * 100, '999.00%') END AS null_frac, pg_size_pretty((pg_relation_size(c.oid) * s.null_frac)::bigint) AS expected_saving FROM pg_class c JOIN pg_index i ON i.indexrelid = c.oid JOIN pg_attribute a ON a.attrelid = c.oid JOIN pg_class c_table ON c_table.oid = i.indrelid JOIN pg_indexes ixs ON c.relname = ixs.indexname LEFT JOIN pg_stats s ON s.tablename = c_table.relname AND a.attname = s.attname WHERE -- Primary key cannot be partial NOT i.indisprimary -- Exclude already partial indexes AND i.indpred IS NULL -- Exclude composite indexes AND array_length(i.indkey, 1) = 1 -- Exclude indexes without null_frac ratio AND coalesce(s.null_frac, 0) != | AccessShareLock | 0.0-5400 seconds | |
| 2493520 | pg_tablespace_spcname_index | true | /* ECTO_PSQL_EXTRAS: Find indexes with a high ratio of NULL values */ SELECT c.oid, c.relname AS index, pg_size_pretty(pg_relation_size(c.oid)) AS index_size, i.indisunique AS unique, a.attname AS indexed_column, CASE s.null_frac WHEN 0 THEN '' ELSE to_char(s.null_frac * 100, '999.00%') END AS null_frac, pg_size_pretty((pg_relation_size(c.oid) * s.null_frac)::bigint) AS expected_saving FROM pg_class c JOIN pg_index i ON i.indexrelid = c.oid JOIN pg_attribute a ON a.attrelid = c.oid JOIN pg_class c_table ON c_table.oid = i.indrelid JOIN pg_indexes ixs ON c.relname = ixs.indexname LEFT JOIN pg_stats s ON s.tablename = c_table.relname AND a.attname = s.attname WHERE -- Primary key cannot be partial NOT i.indisprimary -- Exclude already partial indexes AND i.indpred IS NULL -- Exclude composite indexes AND array_length(i.indkey, 1) = 1 -- Exclude indexes without null_frac ratio AND coalesce(s.null_frac, 0) != | AccessShareLock | 0.0-5400 seconds | |
| 2493520 | pg_namespace_nspname_index | true | /* ECTO_PSQL_EXTRAS: Find indexes with a high ratio of NULL values */ SELECT c.oid, c.relname AS index, pg_size_pretty(pg_relation_size(c.oid)) AS index_size, i.indisunique AS unique, a.attname AS indexed_column, CASE s.null_frac WHEN 0 THEN '' ELSE to_char(s.null_frac * 100, '999.00%') END AS null_frac, pg_size_pretty((pg_relation_size(c.oid) * s.null_frac)::bigint) AS expected_saving FROM pg_class c JOIN pg_index i ON i.indexrelid = c.oid JOIN pg_attribute a ON a.attrelid = c.oid JOIN pg_class c_table ON c_table.oid = i.indrelid JOIN pg_indexes ixs ON c.relname = ixs.indexname LEFT JOIN pg_stats s ON s.tablename = c_table.relname AND a.attname = s.attname WHERE -- Primary key cannot be partial NOT i.indisprimary -- Exclude already partial indexes AND i.indpred IS NULL -- Exclude composite indexes AND array_length(i.indkey, 1) = 1 -- Exclude indexes without null_frac ratio AND coalesce(s.null_frac, 0) != | AccessShareLock | 0.0-5400 seconds | |
| 2493520 | pg_namespace_oid_index | true | /* ECTO_PSQL_EXTRAS: Find indexes with a high ratio of NULL values */ SELECT c.oid, c.relname AS index, pg_size_pretty(pg_relation_size(c.oid)) AS index_size, i.indisunique AS unique, a.attname AS indexed_column, CASE s.null_frac WHEN 0 THEN '' ELSE to_char(s.null_frac * 100, '999.00%') END AS null_frac, pg_size_pretty((pg_relation_size(c.oid) * s.null_frac)::bigint) AS expected_saving FROM pg_class c JOIN pg_index i ON i.indexrelid = c.oid JOIN pg_attribute a ON a.attrelid = c.oid JOIN pg_class c_table ON c_table.oid = i.indrelid JOIN pg_indexes ixs ON c.relname = ixs.indexname LEFT JOIN pg_stats s ON s.tablename = c_table.relname AND a.attname = s.attname WHERE -- Primary key cannot be partial NOT i.indisprimary -- Exclude already partial indexes AND i.indpred IS NULL -- Exclude composite indexes AND array_length(i.indkey, 1) = 1 -- Exclude indexes without null_frac ratio AND coalesce(s.null_frac, 0) != | AccessShareLock | 0.0-5400 seconds | |
| 2493520 | pg_stats | true | /* ECTO_PSQL_EXTRAS: Find indexes with a high ratio of NULL values */ SELECT c.oid, c.relname AS index, pg_size_pretty(pg_relation_size(c.oid)) AS index_size, i.indisunique AS unique, a.attname AS indexed_column, CASE s.null_frac WHEN 0 THEN '' ELSE to_char(s.null_frac * 100, '999.00%') END AS null_frac, pg_size_pretty((pg_relation_size(c.oid) * s.null_frac)::bigint) AS expected_saving FROM pg_class c JOIN pg_index i ON i.indexrelid = c.oid JOIN pg_attribute a ON a.attrelid = c.oid JOIN pg_class c_table ON c_table.oid = i.indrelid JOIN pg_indexes ixs ON c.relname = ixs.indexname LEFT JOIN pg_stats s ON s.tablename = c_table.relname AND a.attname = s.attname WHERE -- Primary key cannot be partial NOT i.indisprimary -- Exclude already partial indexes AND i.indpred IS NULL -- Exclude composite indexes AND array_length(i.indkey, 1) = 1 -- Exclude indexes without null_frac ratio AND coalesce(s.null_frac, 0) != | AccessShareLock | 0.0-5400 seconds | |
| 2493520 | pg_attribute | true | /* ECTO_PSQL_EXTRAS: Find indexes with a high ratio of NULL values */ SELECT c.oid, c.relname AS index, pg_size_pretty(pg_relation_size(c.oid)) AS index_size, i.indisunique AS unique, a.attname AS indexed_column, CASE s.null_frac WHEN 0 THEN '' ELSE to_char(s.null_frac * 100, '999.00%') END AS null_frac, pg_size_pretty((pg_relation_size(c.oid) * s.null_frac)::bigint) AS expected_saving FROM pg_class c JOIN pg_index i ON i.indexrelid = c.oid JOIN pg_attribute a ON a.attrelid = c.oid JOIN pg_class c_table ON c_table.oid = i.indrelid JOIN pg_indexes ixs ON c.relname = ixs.indexname LEFT JOIN pg_stats s ON s.tablename = c_table.relname AND a.attname = s.attname WHERE -- Primary key cannot be partial NOT i.indisprimary -- Exclude already partial indexes AND i.indpred IS NULL -- Exclude composite indexes AND array_length(i.indkey, 1) = 1 -- Exclude indexes without null_frac ratio AND coalesce(s.null_frac, 0) != | AccessShareLock | 0.0-5400 seconds | |
| 2493520 | pg_attribute_relid_attnam_index | true | /* ECTO_PSQL_EXTRAS: Find indexes with a high ratio of NULL values */ SELECT c.oid, c.relname AS index, pg_size_pretty(pg_relation_size(c.oid)) AS index_size, i.indisunique AS unique, a.attname AS indexed_column, CASE s.null_frac WHEN 0 THEN '' ELSE to_char(s.null_frac * 100, '999.00%') END AS null_frac, pg_size_pretty((pg_relation_size(c.oid) * s.null_frac)::bigint) AS expected_saving FROM pg_class c JOIN pg_index i ON i.indexrelid = c.oid JOIN pg_attribute a ON a.attrelid = c.oid JOIN pg_class c_table ON c_table.oid = i.indrelid JOIN pg_indexes ixs ON c.relname = ixs.indexname LEFT JOIN pg_stats s ON s.tablename = c_table.relname AND a.attname = s.attname WHERE -- Primary key cannot be partial NOT i.indisprimary -- Exclude already partial indexes AND i.indpred IS NULL -- Exclude composite indexes AND array_length(i.indkey, 1) = 1 -- Exclude indexes without null_frac ratio AND coalesce(s.null_frac, 0) != | AccessShareLock | 0.0-5400 seconds |