dataegret / pgcompacttable

BSD 3-Clause "New" or "Revised" License
314 stars 48 forks source link

set session_replication_role to replica; issue #28

Open tetlika opened 4 years ago

tetlika commented 4 years ago

since we use Postgresql as a service on azure, there is not permission to execute 'set session_replication_role to replica;';

after we disabled "set session_replication_role to replica;" in pgcompacttable the tool started running, however we dont know what is the impact to run tool with disabled "set session_replication_role to replica;", can you please advice on that?

thanks upfront

Melkij commented 4 years ago

Hello We use session_replication_role to avoid trigger calls in session during table reorganization. If you do not use triggers on processed tables - then you can delete both session_replication_role checks. (one here, another here)

tetlika commented 4 years ago

thanks for fast response @Melkij , in case we have triggers what might be biggest impact if we'l run your tool?

thanks

tetlika commented 4 years ago

P.S.

we dont use replications

Melkij commented 4 years ago

on update triggers will be called for some rows (or even on every row; possible multiple times) in processed tables in this case. Impact obviously depends on yours triggers logic. If you, for example, write all updates to log table for security purposes - you will see many row updates.

AFAIC, it is possible for azure users to run pg_repack.

tetlika commented 4 years ago

thanks @Melkij unfortunately extension "pg_repack" is not supported by Azure Database for PostgreSQL; so the only impact as I understand is increased number of updates we can see?