EQEmulator Forums

EQEmulator Forums (https://www.eqemulator.org/forums/index.php)
-   Archive::Database/World Building (https://www.eqemulator.org/forums/forumdisplay.php?f=625)
-   -   Suggestions to make .sql files more efficient (https://www.eqemulator.org/forums/showthread.php?t=5395)

syntoad 02-21-2003 12:09 AM

Suggestions to make .sql files more efficient
 
If you make a database that is supposed to override previous databases, it's probally best to use REPLACE instead of INSERT, that way it will actually overwrite the info that is already there (and not give you back so many errors.)

And while I'm at it, it is also desirable to use a multipule insert statement, as it will execute much faster than a lot of inserts.

For example:
Code:

INSERT INTO items VALUES (1001, 'item1001'),
INSERT INTO items VALUES (1002, 'item1002'),
INSERT INTO items VALUES (1003, 'item1003');

becomes:
Code:

REPLACE INTO items VALUES (1001, 'item1001'),
 (1002, 'item1002'),
 (1003, 'item1003');

This should make db upgrades easier and faster.


All times are GMT -4. The time now is 01:55 PM.

Powered by vBulletin®, Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.