Hi All ,
    Thakyou for the reply......actually the real problem was,after the grid
was created,we were using a query to fetch the latest record from the
database.That query was again traversing 1 lakh records and therefore it
was taking time.After replacing the query
with latest_record=db.table1.column.max(),its giving  the webpage really
fast, in around 1.30 seconds.....Thakyou again......

Regards newbie




On Fri, Feb 22, 2013 at 8:07 PM, Massimo Di Pierro <
massimo.dipie...@gmail.com> wrote:

> Can we also see what event_pretty does?
>
>
> On Friday, 22 February 2013 04:15:11 UTC-6, newbie wrote:
>
>> I cross-verified and got the same result , timings is 32.00 ms for count
>> query.Anyways, please find below the model and controller code:
>>
>> Model:
>>
>> db.define_table('table1',
>>    Field('device', type="reference devices", ondelete="SET NULL"),
>>    Field('type', 'integer'),
>>    Field('message', 'string', represent=event_pretty),
>>    Field('timestamp', 'integer', label="Sensor Time Stamp"),
>>    Field('seq', 'integer', label="Sequence Number"),
>>    Field('serverTS', 'string', label="Server Time Stamp"),
>>    Field('user', type="reference auth_user", ondelete="SET NULL"))
>>
>> Controller:
>>
>> @auth.requires_login()
>> def index():
>>     query_table1 = db.table1
>>     grid = SQLFORM.grid(query=query_**table1,
>>                         editable=None,
>>                         deletable=None,
>>                         
>> create=False,orderby=~db.**table1.id<http://db.table1.id>
>> )
>>     return dict(grid=grid)
>>
>>
>>
>> On Fri, Feb 22, 2013 at 3:26 PM, Niphlod <nip...@gmail.com> wrote:
>>
>>> if SQLite takes 32 ms to count 10^5 records, than I'm impressed (or,
>>> more likely, astonished) with its performance (but I remain dubious that
>>> you're reading the correct timings).
>>> Seems that the database is not the issue. Can we see the model for that
>>> table ?
>>>
>>>
>>> On Friday, February 22, 2013 10:07:33 AM UTC+1, newbie wrote:
>>>
>>>> I mentioned wrong data for the query which SQLFORM.grid is executed so
>>>> sorry for that, basically that query is taking 0.00 ms and below query has
>>>> taken 32.00 ms:
>>>>
>>>> SELECT count(*) FROM table1 WHERE (table1.id > 0);
>>>>
>>>>
>>>>
>>>> On Fri, Feb 22, 2013 at 2:24 PM, Niphlod <nip...@gmail.com> wrote:
>>>>
>>>>>  wonderful. thanks.
>>>>> @newbie: can you see how many seconds it takes the query that has a
>>>>> count() in it ? that one is probably taking more than a few millisec.
>>>>>
>>>>> PS: SQlite starts to be kinda not the preferred way to store 10^5
>>>>> records.
>>>>>
>>>>>
>>>>>  --
>>>>>
>>>>> ---
>>>>> 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+un...@**googlegroups.com.
>>>>>
>>>>> For more options, visit 
>>>>> https://groups.google.com/**grou**ps/opt_out<https://groups.google.com/groups/opt_out>
>>>>> .
>>>>>
>>>>>
>>>>>
>>>>
>>>>  --
>>>
>>> ---
>>> 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+un...@**googlegroups.com.
>>> For more options, visit 
>>> https://groups.google.com/**groups/opt_out<https://groups.google.com/groups/opt_out>
>>> .
>>>
>>>
>>>
>>
>>  --
>
> ---
> 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/groups/opt_out.
>
>
>

-- 

--- 
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/groups/opt_out.


Reply via email to