(
  pg_stat_user_tables_last_autovacuum > 0
) and (
  time
  (
  ) - pg_stat_user_tables_last_autovacuum
) > 60 * 60 * 24 * 10
