count = async (tbl, whereObj) => {
  const { where, values } = mkWhere(whereObj);
  if (!where) {
    try {
      // fast count for large table but may be stale
      // https://stackoverflow.com/questions/7943233/fast-way-to-discover-the-row-count-of-a-table-in-postgresql
      //https://www.citusdata.com/blog/2016/10/12/count-performance/
      const sql = `SELECT (CASE WHEN c.reltuples < 0 THEN NULL
             WHEN c.relpages = 0 THEN float8 '0'  -- empty table
             ELSE c.reltuples / c.relpages END
     * (pg_catalog.pg_relation_size(c.oid)
      / pg_catalog.current_setting('block_size')::int)
       )::bigint
FROM   pg_catalog.pg_class c
WHERE  c.oid = '"${getTenantSchema()}"."${sqlsanitize(tbl)}"'::regclass`;
      sql_log(sql);
      const tq = await getMyClient().query(sql, []);
      const n = +tq.rows[0].int8;
      if (n && n > 10000) return n;
    } catch {
      //skip fast estimate
    }
  }

  const sql = `SELECT COUNT(*) FROM "${getTenantSchema()}"."${sqlsanitize(
    tbl
  )}" ${where}`;
  sql_log(sql, values);
  const tq = await getMyClient().query(sql, values);

  return parseInt(tq.rows[0].count);
}
Get count of rows in table
@param {string} - tbl - table name
@param {object} - whereObj - where object
@returns {Promise<number>} count of tables