Home › Forums › Other › How to setup a database table? › Re: How to setup a database table?
June 30, 2013 at 11:15 pm
#141095
Participant
that’s what I thought – if `url`, `title`, or combination are unique values, then use one, the other, or both as your PK*. You don’t need the `id` column. It’s just extra overhead to maintain.
*I’d go with both, since you’re likely to be querying for both (correct?). If you do
`PRIMARY KEY( url,title )`
and make sure you always query like
`SELECT url,title …`
(meaning, _not like_ `SELECT title,url …`), then you’ll be able to read from the index (_FAST!!!_) and never have to touch the table itself.