use PgSqlTransaction to speed up