Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

mbtiler: use Wall mode and create index on tiles #29

Open
wants to merge 3 commits into
base: master
Choose a base branch
from

Conversation

DoFabien
Copy link

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

 Wall mode speedup by about 10 the speed of writing in the database

Create index on tiles for efficient access to this table
@andrewharvey
Copy link
Contributor

Whoah that's amazing.

@DoFabien
Copy link
Author

DoFabien commented Feb 25, 2021

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)

Otherwise, the file .mbtiles-wal becomes huge (same size as the final file). The result is the need to have twice the size of the final Mbtiles on the hard drive
@jdesboeufs
Copy link

jdesboeufs commented Jun 29, 2022

Any update?
It is definitely a very good idea!

@kannes
Copy link
Contributor

kannes commented Apr 9, 2023

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants