pgtoolkit icon indicating copy to clipboard operation
pgtoolkit copied to clipboard

Max execution time

Open kustodian opened this issue 10 years ago • 4 comments

Since pgcompact is used as a database maintenance tool, you usually have a limited time when you can do maintenance (e.g. when there is less db activity), so it would be really nice if you could define a max execution time which would limit how long pgcompact can run. For example --max-execution-time=3600 which would limit execution to 1 hour.

kustodian avatar Mar 13 '15 11:03 kustodian

It makes sense. However, I guess it would be better to override SIGINT to stop pgcompact correctly, eg. wait for an ongoing query or process to finish, like the reindex one, instead of just breaking it in the middle, what might lead to unpleasant side effects like not dropped temporary indexes. So one could either safely Ctrl+C pgcompact or schedule kill <pid> or killall pgcompact on a particular time when the inactivity window ends for example (kill and killall use SIGINT by default). That would be more general and more flexible.

Thoughts?

grayhemp avatar Mar 31 '15 06:03 grayhemp

I agree, that would be a much better option. We randomly encounter pgcompact temp tables and indices all the time, and they shouldn't exist.

On Tue, Mar 31, 2015, 03:24 Sergey Konoplev [email protected] wrote:

It makes sense. However, I guess it would be better to override SIGINT to stop pgcompact correctly, eg. wait for an ongoing query or process to finish, like the reindex one, instead of just breaking it in the middle, what might lead to unpleasant side effects like not dropped temporary indexes. So one could either safely Ctrl+C pgcompact or schedule kill or killall pgcompact on a particular time when the inactivity window ends for example (kill and killall use SIGINT by default). That would be more general and more flexible.

Thoughts?

— Reply to this email directly or view it on GitHub https://github.com/grayhemp/pgtoolkit/issues/7#issuecomment-87957721.

kustodian avatar Mar 31 '15 11:03 kustodian

Putting it down to my TODO then.

BTW, pgcompact does not create temp tables, only indexes.

grayhemp avatar Mar 31 '15 14:03 grayhemp

Yeah, sorry, you are correct, only indices.

On Tue, Mar 31, 2015, 11:58 Sergey Konoplev [email protected] wrote:

Putting it down to my TODO then.

BTW, pgcompact does not create temp tables, only indexes.

— Reply to this email directly or view it on GitHub https://github.com/grayhemp/pgtoolkit/issues/7#issuecomment-88120700.

kustodian avatar Mar 31 '15 19:03 kustodian