When drop or truncate a not too big table(4M rows) in my redshift database, it take very very long(hours) to complete. Does anybody experience the same issue?
Thanks
IMO AccessShareLock on tables also causes DDL commands to get stuck.
Run this query to figure out pids of AccessShareLock
select
current_time,
c.relname,
l.database,
l.transaction,
l.pid,
a.usename,
l.mode,
l.granted
from pg_locks l
join pg_catalog.pg_class c ON c.oid = l.relation
join pg_catalog.pg_stat_activity a ON a.procpid = l.pid
where l.pid <> pg_backend_pid();
Kill the processes using select pg_terminate_backend(
Ensure that all your read-only applications close and releases all connections and hence these locks!