Menu

#1 Improve speed of csv-import

open
nobody
None
5
2007-10-19
2007-10-19
No

The speed imports can be speed up.

Firstly, a "clean" DB must not have an index in tabel map. If then the import starts, it can go much faster.

Secondly, the index must be created after having finished the import.

I added the fallowing line after if( $booLastRun )

// add index
$this->oDB->query('ALTER TABLE `'.$this->oDB->tblMap.'` ADD PRIMARY KEY (`x`,`y`)');

And to the clean() method:
$this->oDB->query('DELETE FROM '.$this->oDB->tblMapData.';');
$intCount += intval( $this->oDB->affected_rows() );
$this->oDB->query('ALTER TABLE '.$this->oDB->tblMapData.' DROP PRIMARY KEY;');

Discussion


Log in to post a comment.