sqlite issue in 2.7.5

mbg1708 at planetmail.com mbg1708 at planetmail.com
Mon Sep 9 19:55:50 EDT 2013


On Tuesday, September 3, 2013 8:22:42 AM UTC-4, Alister wrote:
> On Mon, 02 Sep 2013 22:13:27 +0000, Joseph L. Casale wrote:
> 
> 
> 
> > I have been battling an issue hopefully someone here has insight with.
> 
> > 
> 
> > I have a database with a few tables I perform a query against with some
> 
> > joins against columns collated with NOCASE that leverage = comparisons.
> 
> > 
> 
> > Running the query on the database opened in sqlitestudio returns the
> 
> > results in under a minute. Running the query in Python with sqlite3
> 
> > doesn't return results for several hours. I haven't figured out what
> 
> > pragmas or other shortcuts sqlitestudio uses to provide the results so
> 
> > fast.
> 
> > 
> 
> > Using apsw returns the dataset nearly instantaneously but the
> 
> > connection/cursor/commit differences are too drastic and would force far
> 
> > too large a rewrite for the module change.
> 
> > 
> 
> > Anyone by chance know the underlying changes required in the sqlite3
> 
> > module to replicate what sqlitestudio is doing behind the scenes?
> 
> > 
> 
> > Thanks,
> 
> > jlc
> 
> 
> 
> you are almost certainly doing something drastically wrong
> 
> can you provides examples of your code & the data structure otherwise I 
> 
> doubt that anyone will be able to assist.
>  
> 
> -- 
> 
> To err is human, to forgive, beyond the scope of the Operating System.

This pragma speeds up most processes 10-20 times (yes 10-20):
    pragma synchronous=OFF

See the SQLITE documentation for an explanation.
I've found no problems with this setting.



More information about the Python-list mailing list