At 05:15 AM 6/24/99 , Sasha Pachev wrote:
>> Dropping the indexes and recreating them after import is not a good
>> solution as it takes about an hour to rebuild each index.
>>
>> Selects are actually quite quick - it's just importing. Is there any way
>> to speed it up?
>>
>
>Drop all indeces before you import, then add them back when you are
>done.
thanks for responding. in my original message (quoted above) i said that
creating indexes is too time-consuming.
i did what you suggested though, and you are right - it only takes a few
seconds to import the data when there are no indexes. unfortunately i need
the indexes!
recreating them afterwards is incredibly slow. as you can see from this
mysqladmin processlist output:
+-----+------+-----------+----------+-----------+------+-------------------+
---------------------------------------------+
| Id | User | Host | db | Command | Time | State
| Info |
+-----+------+-----------+----------+-----------+------+-------------------+
---------------------------------------------+
| 147 | jsd | localhost | pageview | Query | 3279 | copy to tmp table
| alter table pageview add index urlidx (url) |
| 155 | jsd | localhost | | Processes | 0 |
| |
+-----+------+-----------+----------+-----------+------+-------------------+
---------------------------------------------+
it's been running for almost an hour now and there is no end in sight. and
i need to do this for two indexes! there's no way i can keep adding and
removing the indexes every day. surely there has to be a way to speed up
indexing. i am running mysqld with key_buffer=20M.
Jon Drukman
Director Of Technology
GameSpot