1
0
mirror of https://github.com/postgres/postgres.git synced 2025-10-22 14:32:25 +03:00

Refactor relation opening for VACUUM and ANALYZE

VACUUM and ANALYZE share similar logic when it comes to opening a
relation to work on in terms of how the relation is opened, in which
order locks are tried and how logs should be generated when something
does not work as expected.

This commit refactors things so as both use the same code path to handle
the way a relation is opened, so as the integration of new options
becomes easier.

Author: Michael Paquier
Reviewed-by: Nathan Bossart
Discussion: https://postgr.es/m/20180927075152.GT1659@paquier.xyz
This commit is contained in:
Michael Paquier
2018-10-02 08:53:38 +09:00
parent cf3dfea45b
commit e3a25ab9ea
3 changed files with 117 additions and 109 deletions

View File

@@ -188,6 +188,8 @@ extern void vac_update_datfrozenxid(void);
extern void vacuum_delay_point(void);
extern bool vacuum_is_relation_owner(Oid relid, Form_pg_class reltuple,
int options);
extern Relation vacuum_open_relation(Oid relid, RangeVar *relation,
VacuumParams *params, int options, LOCKMODE lmode);
/* in commands/vacuumlazy.c */
extern void lazy_vacuum_rel(Relation onerel, int options,