Hi, I have notice this:
When i use this data = db(db.subjects_sources.media_group==1).select( db.subjects_sources.id, db.subjects_sources.name, db.subjects_sources.media_url, ) My computer just hangs (8 GB RAM), growing slowly the RAM, media_group is indexed. However if i put the equivalent sql inside the psql interpreter: 'SELECT subjects_sources.id, subjects_sources.name, subjects_sources.media_url FROM subjects_sources WHERE (subjects_sources.media_group = 1);' the result takes less than 2 secs. Is a DAL issue? Saludos, -------------------------------- Alfonso de la Guarda Twitter: @alfonsodg Redes sociales: alfonsodg Telef. 991935157 1024D/B23B24A4 5469 ED92 75A3 BBDB FD6B 58A5 54A1 851D B23B 24A4 On Wed, Jul 8, 2015 at 6:51 PM, Leonel Câmara <leonelcam...@gmail.com> wrote: > If your table is really big it's very important to pick which columns you > want in your selects. In particular, if you're using the grid make sure you > use the fields keyword argument and only pick the fields you really need. If > you usually sort/search this grid using some of the fields, make sure > they're indexed. > > You can also check the queries you're doing on this table and use EXPLAIN to > see which ones are slow and try to optimize them. > > Your postgresql server probably also needs some tuning or really just more > memory, there's a reason one of the first scalability changes people make is > getting the database its own machine where it runs alone. > > It's also normal to have a warm up period when things start slow until the > database cache starts doing its work. > > These are all pretty generic advices, we would need to see your table > structure and what your controllers are doing to try to understand why it's > slow. Postgresql is capable of handling terabytes of data you should be able > to manage this. > > -- > 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. > For more options, visit https://groups.google.com/d/optout. -- 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. For more options, visit https://groups.google.com/d/optout.