Clanintern Clanintern Clanintern

Forum

Öffentliche Foren
FORUM: Spiele & Computer THEMA: SQLite
AUTOR BEITRAG
Avantasia

RANG Deckschrubber

#1 - 23.01 11:35

Hallo
Ich versuche gerade SQLite mit MySQL zu vergleichen und bin unter folgendes gestossen

3-Tabellen-Join ohne Indizes SQlite 1104,7357 s MySQL
0,4055s




warum ist sqlite so langsam bei komplexeren Abfragen über mehrere Tabellen ohne Indizes weiss das einer ??? Ihr würdet mir echt helfen
phoeniks

RANG Godlike

#2 - 19.02 20:10

Wieso das so ist, kann ich dir leider nicht verraten.
Wenn du Indizes setzt - wie sehen die Zeiten dann aus?

Was mir bei Einfügeoperationen sehr viel Beschleunigung gebracht hat war
PRAGMA synchronous = OFF

quote:
PRAGMA synchronous;
PRAGMA synchronous = FULL; (2)
PRAGMA synchronous = NORMAL; (1)
PRAGMA synchronous = OFF; (0)

Query or change the setting of the "synchronous" flag. The first (query) form will return the setting as an integer. When synchronous is FULL (2), the SQLite database engine will pause at critical moments to make sure that data has actually been written to the disk surface before continuing. This ensures that if the operating system crashes or if there is a power failure, the database will be uncorrupted after rebooting. FULL synchronous is very safe, but it is also slow. When synchronous is NORMAL, the SQLite database engine will still pause at the most critical moments, but less often than in FULL mode. There is a very small (though non-zero) chance that a power failure at just the wrong time could corrupt the database in NORMAL mode. But in practice, you are more likely to suffer a catastrophic disk failure or some other unrecoverable hardware fault. With synchronous OFF (0), SQLite continues without pausing as soon as it has handed data off to the operating system. If the application running SQLite crashes, the data will be safe, but the database might become corrupted if the operating system crashes or the computer loses power before that data has been written to the disk surface. On the other hand, some operations are as much as 50 or more times faster with synchronous OFF.

In SQLite version 2, the default value is NORMAL. For version 3, the default was changed to FULL.

http://www.sqlite.org/pragma.html

Eventuell findest du ja noch den einen oder anderen Schalter der die Performance steigert...


Hier gibts nen Performance-Vergleich zwischen SQLite MySQL und Postgres....
http://www.sqlite.org/cvstrac/wiki?p=SpeedComparison

Wenn man das mal so überfliegt entsteht der Eindruck als ob SQLite erst mit Indizes und Transaktionen so richtig schnell wird.....