Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Is it possible to drop a primary key index in MySQL?

Is it possible to drop a primary key index in MySQL (version 5.1.47).

This is to optimize the insert performance.

like image 674
prp Avatar asked Oct 26 '25 07:10

prp


1 Answers

If you're sure this is what you want to do (note Paul Tomblin's comment on your question), then from the ALTER TABLE docs:

ALTER TABLE `tablename` DROP PRIMARY KEY;

DROP PRIMARY KEY drops the primary key. If there is no primary key, an error occurs.

like image 150
Dominic Rodger Avatar answered Oct 28 '25 21:10

Dominic Rodger