Re: [Zope] ZSQL batching with dtml-in

2005-12-09 Thread Chris Withers

Ed Colmar wrote:


Will the database be queried for all results, and only have 20 
displayed, or will the database just return the 20 that are needed?


The database will get hammered every time ;-)

There was a thread between myself and Charlie from eGenix on the zope-db 
list earlier this week...


...and stop using dtml!

*grinz*

Chris

--
Simplistix - Content Management, Zope  Python Consulting
   - http://www.simplistix.co.uk

___
Zope maillist  -  Zope@zope.org
http://mail.zope.org/mailman/listinfo/zope
**   No cross posts or HTML encoding!  **
(Related lists - 
http://mail.zope.org/mailman/listinfo/zope-announce

http://mail.zope.org/mailman/listinfo/zope-dev )


[Zope] ZSQL batching with dtml-in

2005-12-08 Thread Ed Colmar
Do ZSQL methods communicate with the dtml-in call and understand the 
size attribute?


for example, in this dtml-in statement:
dtml-in SQL_get_large_list size=20 start=query_start
/dtml-in

Will the database be queried for all results, and only have 20 
displayed, or will the database just return the 20 that are needed?


Thanks for the insight!

-Ed
___
Zope maillist  -  Zope@zope.org
http://mail.zope.org/mailman/listinfo/zope
**   No cross posts or HTML encoding!  **
(Related lists - 
http://mail.zope.org/mailman/listinfo/zope-announce

http://mail.zope.org/mailman/listinfo/zope-dev )


Re: [Zope] ZSQL batching with dtml-in

2005-12-08 Thread David H

Ed Colmar wrote:

Do ZSQL methods communicate with the dtml-in call and understand the 
size attribute?


for example, in this dtml-in statement:
dtml-in SQL_get_large_list size=20 start=query_start
/dtml-in

Will the database be queried for all results, and only have 20 
displayed, or will the database just return the 20 that are needed?


Thanks for the insight!

-Ed
___


Ed,
Just add a Z Search Interface to a folder that can acquire your zSQL 
method(s).  I think it will create a sample of what you want to do in 
either ZPT or DTML.  Then you can experiment.


You can use the advanced tab to tell zSqL methods how many data 
records to download per get and how many to cache.


David

___
Zope maillist  -  Zope@zope.org
http://mail.zope.org/mailman/listinfo/zope
**   No cross posts or HTML encoding!  **
(Related lists - 
http://mail.zope.org/mailman/listinfo/zope-announce

http://mail.zope.org/mailman/listinfo/zope-dev )


Re: [Zope] ZSQL batching with dtml-in

2005-12-08 Thread Tino Wildenhain
Am Donnerstag, den 08.12.2005, 13:46 -0800 schrieb Ed Colmar:
 Do ZSQL methods communicate with the dtml-in call and understand the 
 size attribute?

Not really.

 for example, in this dtml-in statement:
 dtml-in SQL_get_large_list size=20 start=query_start
 /dtml-in
 
 Will the database be queried for all results, and only have 20 
 displayed, or will the database just return the 20 that are needed?

Well, this depends (in theory at least :) on the database
adaptor. It could just fetch the results up to 20 but
usually it will just fetch all and cut the batch
out of it. This isnt so bad as it seems because
you can have the ZSQL Method cache the result so
the database isnt asked any time.

You dont need DTML for batching. There is a batch
module you can use in python scripts as well
(and with ZPT)

HTH
Tino

___
Zope maillist  -  Zope@zope.org
http://mail.zope.org/mailman/listinfo/zope
**   No cross posts or HTML encoding!  **
(Related lists - 
 http://mail.zope.org/mailman/listinfo/zope-announce
 http://mail.zope.org/mailman/listinfo/zope-dev )