Got a MySQL database with a table consisting values based on zipcode and house number. Primary key therefore is chosen to be zipcode and house number as these are the fields to search for. The database contains approximately 10 million records.
One specific zipcode consists of ~100000 different house numbers and extremely slow on inserting (1 hour per 10000 records).
Programming language is Java and I'm using prepared statements in a batch of 10000 with autocommit on false.
The structure of the table is the following:
+-----------------+-------------+------+-----+---------+-------+ | Field | Type | Null | Key | Default | Extra | +-----------------+-------------+------+-----+---------+-------+ | zipcode | varchar(6) | NO | PRI | NULL | | | house_no | int(11) | NO | PRI | NULL | | | sanddcode | varchar(45) | NO | | NULL | | | depot | varchar(3) | NO | | NULL | | | network_point | varchar(6) | NO | | NULL | | | region | varchar(3) | NO | | NULL | | | seq | int(11) | NO | | NULL | | | cluster_id | varchar(1) | NO | | NULL | | | strand_id | int(11) | NO | | NULL | | | strand_props_id | int(11) | NO | | NULL | | | version_id | int(11) | NO | PRI | NULL | | +-----------------+-------------+------+-----+---------+-------+
Anyone who knows a solution to this? Thanks!