Hi Sandeep,

A bit a late reply, but it may be useful for someone later-on.

I recently had the exact same issue, quite suddenly, things started to 
become slow.
Here's what I did to solve it:

*First thing to do:* make a backup of your project!

*Second thing* to do is to vacuum your db, which does some optimizations 
that gets rid of some garbage in your db.
You can just do:   db.executesql('VACUUM') 

Ref: https://www.sqlite.org/lang_vacuum.html

*Third thing* you can do is to:
0) Make sure all your tables have a uuid field 
1) Export all your data to a csv file: 
with open('somefile.csv', 'wb') as dumpfile: db.export_to_csv_file(dumpfile)
2) Remove your db tables
3) Import again all your data from the csv file: 
with open('somefile.csv', 'rb') as dumpfile: 
db.import_from_csv_file(dumpfile, id_map={})

Ref: 
http://web2py.com/books/default/chapter/29/06/the-database-abstraction-layer#CSV-all-tables-at-once-

In my case the export/import of the data finally did the trick.
I'm still not sure why this seems to speed up everything, maybe someone in 
this forum here has a good explanation for that?
Hope it works for you too!

On Saturday, May 2, 2020 at 12:57:27 PM UTC+2 eudor...@gmail.com wrote:

> Hi Sandeep,
>
> Would be good if you can supply a bit more information in order to help 
> you find the solution.
>
> questions:
> 1: Has your database grown recently?
> 2: Is web2py slow on all queries or just on some tables? 
> 3: Can you use _lasesql to see your sql calls and timings?
> 4: Are you using SQLFORM.grid or custom forms to do your queries?
> 5: Some genric idea of what you are trying to do?
>
> BR
> John 
>
>
>
> On Saturday, 2 May 2020 12:20:44 UTC+2, Sandeep Bondre wrote:
>
>> I do not see a solution to this problem .
>>
>> Can some one really help what is the solution to this 
>>
>> Regards
>>
>> Sandeep
>>
> sandee...@gmail.com
>>
>

-- 
Resources:
- http://web2py.com
- http://web2py.com/book (Documentation)
- http://github.com/web2py/web2py (Source code)
- https://code.google.com/p/web2py/issues/list (Report Issues)
--- 
You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to web2py+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/web2py/5b842cdb-d49f-4491-b761-246559334998n%40googlegroups.com.

Reply via email to