How do I add indices to MySQL tables?

后端 未结 7 1847
北荒
北荒 2020-11-22 13:54

I\'ve got a very large MySQL table with about 150,000 rows of data. Currently, when I try and run

SELECT * FROM table WHERE id = \'1\';

the

相关标签:
7条回答
  • 2020-11-22 14:29
    ALTER TABLE `table` ADD INDEX `product_id_index` (`product_id`)
    

    Never compare integer to strings in MySQL. If id is int, remove the quotes.

    0 讨论(0)
提交回复
热议问题