fix(engine): Fix statistics select statement

- fix select statements for postgres:
  -- duplicated Activity Statistic queries