rio-rgbify icon indicating copy to clipboard operation
rio-rgbify copied to clipboard

mbtiler: use Wall mode and create index on tiles

Open DoFabien opened this issue 3 years ago • 4 comments

Hello, Great job! But writing the tiles to the database is so slow ... You can increase by 10 just by using WALL MODE of sqlite

Create index on tiles for efficient access to this table

DoFabien avatar Feb 25 '21 08:02 DoFabien

Whoah that's amazing.

andrewharvey avatar Feb 25 '21 09:02 andrewharvey

I lied. For my test, I used a MNT 5 meters from "la Réunion" (epsg: 3857, 132Mo) With the original version, it took 1470 seconds With conn.execute('pragma journal_mode=wal'), 432s (only 3.4x faster)

But with the commit correctly placed, after the inserts, it took 76s about 20 times faster

PS: The input/output data are on my big and slow external HDD (5200 t/m)

DoFabien avatar Feb 25 '21 15:02 DoFabien

Any update? It is definitely a very good idea!

jdesboeufs avatar Jun 29 '22 20:06 jdesboeufs

I'd suggest to create the index after the tiles have been created. There does not seem to be any use of it during tile creation and it would have to be updated many times during that process.

kannes avatar Apr 09 '23 10:04 kannes