Results 1 to 8 of 8
Thread: speed up sql - keys
May 31, 2011, 13:05 #1
- Join Date
- May 2006
- 0 Post(s)
- 0 Thread(s)
speed up sql - keys
I'm experiencing slow sql lookup in my product table which has more than 300.000 entries. It takes very for mysql (using php) to lookup for specific entry. I use varchar permalink and int site_id to match the row.
How can I speed up this lookup?
Should creating index on 2 columns (site_id and permalink) help?
If so, for how much should this speed up the lookup?
What else can I do?
I tried doing this but I get the following error:
ALTER TABLE `store`.`products` ADD UNIQUE `permalink_index` ( `site_id` , `permalink` ) MySQL said: Documentation #1062 - Duplicate entry 'test-product-name' for key 'permalink_index'
Thanks a lot for help!