[Qgis-developer] very slow on creating a new empty spatialite db

Ing. Pierluigi De Rosa pierluigi.derosa at gfosservices.it
Fri Aug 7 07:43:11 PDT 2015


Dear all,

I'm experiencing than when I create a new empty spatialite from qgis it
takes long time to do it.
Here belo is the code I tried:

---------------
# -*- coding: utf-8 -*-
from qgis.core import *
import qgis.utils
from pyspatialite import dbapi2 as db
import timeit

start = timeit.default_timer()

dbase='/home/pierluigi/Scrivania/db.sqlite'
conn = db.connect(dbase)
cur = conn.cursor()

sql = 'SELECT InitSpatialMetadata()'
cur.execute(sql)
conn.commit()

stop = timeit.default_timer()
print stop - start
-----------

If i run this code my pc start swapping so much and to prepare the empty
db (the total variable) it takes 722.3559 sec or better ABOUT 12
MINUTES!!!

Of course the same is if I just save a layer into spatialite format.

Why is this happens?
Is there a work around for my code to speed up che db creation?

I'm running qgis on ubuntu 14.04, qgis 2.8 LTS from launchpad unstable
repo.

Thanks
Pierluigi


-- 

                                    
________________________________________________________________________
Ing. Pierluigi De Rosa (PhD)
Studio Associato GFOSSERVICES
                
Presso CAMPUS Via F.lli Cairoli 25 - 06127 Perugia (PG) 
fax: 075 7823038
cel: 3497558268
web: www.gfosservices.it
skype: pierluigi.derosa 



More information about the Qgis-developer mailing list