Yeah see that was my original question how to tell grid to only select/count the first 50,000 records instead of it just generating pages for all the records. I single ad in our site has had over 60,000 views.
I am planing to move the adviewer to mongodb if I can't resolve this issue. On Mon, Apr 23, 2012 at 4:11 AM, Martín Mulone <[email protected]>wrote: > perhaps we can make some lambda to count, but make sure that is the > count() thing, run some benchmark. > > > 2012/4/23 Niphlod <[email protected]> > >> unfortunately counting on postgres is a heavy operation, and it's pretty >> "famous" for this http://wiki.postgresql.org/wiki/Slow_Counting......... >> maybe you can try limiting the amount to, let's say, 20000 (if it's >> possible as per requirements of your app) and see if there are differences. >> >> In theory >> >> SELECT COUNT(*) from mytable >> >> and >> >> SELECT COUNT(*) from mytable LIMIT 20000 >> >> for a 500000 records table is faster. >> >> You could have a "default" grid of the 20000 records and then an >> "advanced" if users are willing to scroll over the n-thousand-x page. >> > > > > -- > http://www.tecnodoc.com.ar > > -- -- Regards, Bruce Wade http://ca.linkedin.com/in/brucelwade http://www.wadecybertech.com http://www.fittraineronline.com - Fitness Personal Trainers Online http://www.warplydesigned.com

