class PhasingPollTable extends EntityDbTable<PhasingPoll> {

    public int getAllPhasedTransactionsCount() throws SQLException {
        try (Connection con = getDatabaseManager().getDataSource().getConnection();
             @DatabaseSpecificDml(DmlMarker.NAMED_SUB_SELECT)
             PreparedStatement pstmt = con.prepareStatement("select count(*) from (select id from phasing_poll UNION select id from phasing_poll_result)")) {
            try (ResultSet rs = pstmt.executeQuery()) {
                rs.next();
                return rs.getInt(1);
            }
        }
    }

    @Inject public  PhasingPollTable(Blockchain blockchain);

}