Which column should I count? Hi. I'm using MySQL 5.6 and have a table looks like this:

    CREATE TABLE foobars(
      a BIGINT NOT NULL,
      b BIGINT NOT NULL,
      c BIGINT NOT NULL,
      INDEX foobars_b_c_idx (b, c)
    );

Now I want to know how many records are there with specific values of "b" and "c":

    SELECT COUNT(a)
    FROM foobars
    WHERE b = :b AND c = :c

(:b and :c are placeholder and will be substituted with the value input by user.)

As the index foobars_b_c_idx doesn't cover the column "a", does the above query make the database to lookup the value of "a" when counting the number of records? I think it shouldn't because the database know that the column "a" must not be null, so using the index should be sufficient.

Should I COUNT(b) instead? (Value of column "b" may not be unique.)

Many thanks.