Hi folks! i have a sql statement that returns three fields, to be known: msg, author, forum_id. I would like to let me users to sort on them. My i have zope do that for me or i have to do it by myself into the sql statement? Which is the best approach (considering performance). Thanks for your help. -- Majority, n.: That quality that distinguishes a crime from a law.
SQL will typically be much faster for a large record set. For a small set, you won't notice the difference. Of course your mileage may vary based on relative server and network speeds (assuming remote SQL), the type of SQL server, etc. Why not try it both ways and see. The coding to try it out is minimal and will give you a good relative performance indication for future development in your environment. - Alan --------------------------------------- Zope tips and tricks site http://twsite.bizland.com/zopetips.htm
-----Original Message----- From: zope-admin@zope.org [mailto:zope-admin@zope.org]On Behalf Of Gustavo Vieira Goncalves Coelho Rios Sent: Tuesday, July 24, 2001 8:24 AM To: zope@zope.org Subject: [Zope] sorting sql result
Hi folks!
i have a sql statement that returns three fields, to be known:
msg, author, forum_id. I would like to let me users to sort on them. My i have zope do that for me or i have to do it by myself into the sql statement? Which is the best approach (considering performance).
Thanks for your help.
-- Majority, n.: That quality that distinguishes a crime from a law.
_______________________________________________ Zope maillist - Zope@zope.org http://lists.zope.org/mailman/listinfo/zope ** No cross posts or HTML encoding! ** (Related lists - http://lists.zope.org/mailman/listinfo/zope-announce http://lists.zope.org/mailman/listinfo/zope-dev )
Gustavo, do it in zope... in the Zope source have a look at the file main.dtml in /lib/python/OFS/dtml/ specifically the skey and rkey variables... this gives you a clear example of how to do it (you can copy and paste it actually)... cheers, Garry On 24 Jul 2001, at 10:24, Gustavo Vieira Goncalves Coelho Rios wrote: From: Gustavo Vieira Goncalves Coelho Rios <gustavo@ifour.com.br> To: zope@zope.org Subject: [Zope] sorting sql result Date sent: Tue, 24 Jul 2001 10:24:02 -0300
Hi folks!
i have a sql statement that returns three fields, to be known:
msg, author, forum_id. I would like to let me users to sort on them. My i have zope do that for me or i have to do it by myself into the sql statement? Which is the best approach (considering performance).
Thanks for your help.
-- Majority, n.: That quality that distinguishes a crime from a law.
_______________________________________________ Zope maillist - Zope@zope.org http://lists.zope.org/mailman/listinfo/zope ** No cross posts or HTML encoding! ** (Related lists - http://lists.zope.org/mailman/listinfo/zope-announce http://lists.zope.org/mailman/listinfo/zope-dev )
+-------------------------------------------+ Garry Steedman mailto:gs@styrax.com Styrax Associates http://www.styrax.com/ "The Good Man has no shape." +-------------------------------------------+
participants (3)
-
Alan Capesius -
Garry Steedman -
Gustavo Vieira Goncalves Coelho Rios