I have a table for storing coupons/discounts, and I want to use the coupon_code column as the primary key, which is a VARCHAR
.
My rationale is that, each coupon will have a unique code, and the only commands I will be running are SELECT ... FROM ... WHERE coupon_code='..'
I won't be doing any joins or indexing, and I don't see there ever being more than a few hundred entries in this table.
It seems to me that this will be OK, but I don't know if there is anything I'm missing/not thinking about.
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…