Level 61
Just index it. Normal index does not force uniqueness.
Hey,
I've got a table like this
INCREMENTAL_ID, ID, STRATEGY, POLICY_ID, ASSIGNED_AT, CREATED_AT, UPDATED_AT
The strategy column is a nonunique text string that I need to index to optimize a count query that's too slow at the moment, but I can't figure out how to go about this. The query I need to optimize looks like this
select count(id) as aggregate
from `external_ids`
where `strategy` = 'long_nono_unique_text_string'
and `assigned_at` is not null;
Could someone please suggest some strategies on how this is usually done? Thanks!
Please or to participate in this conversation.