On 11/18/06, José de Paula Eufrásio Júnior <[EMAIL PROTECTED]> wrote: > > Wooo, that one hit the spot :) > It's exactly in a many-to-many reference table, the part after the > function is the 'where' righ? :) > Correct. :)
> Any idea how 'intensive' is that? Like, in big tables or if used many > times it'll show a big hit on performance or most of the engines/db's > cache this type of data (btw, I'm using MySQL innodb tables). > I'm pretty sure that `count()` is ANSI SQL (i've only used it with sqlite, mysql and postgres, but these are the major 3 that are commonly used with TG). This is very low in terms of any kind of performance hit. All you're getting back from the db is one row and one column (hence the use of `scalar()`) and all the work is being done by the db server. Doing it the other way (i.e. selecting one column from all the rows in the db and then using len() or similar on the result) will cost you more in terms of CPU cycles. Lee -- Lee McFadden blog: http://www.splee.co.uk work: http://fireflisystems.com --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "TurboGears" group. To post to this group, send email to [email protected] To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/turbogears?hl=en -~----------~----~----~----~------~----~------~--~---

