> If you're talking about building queries, your point is moot -- the >> operations happen in the database, not Python. >> > > I don't know what you mean by this... > For complex-queries, I would still be using web2py's DAL layer, even if I > had this ORM on top. I would either use them outside the ORM, or insert > them into the ORM. >
Not sure what you mean here -- you can do simple queries in the db as well as complex filtering in Python -- they are orthogonal considerations. > My example was not meant to show that you should do complex queries in > Python - that would obviously be absurd, and you don't even need a > relational database for that - any NoSQL one would do fine. > Now you've really lost me -- what does any of this have to do with RDBMS vs. NoSQL? And why shouldn't you do complex filtering in Python? > I was giving an example to a case in which I have a simple comparison to > make, and want to reuse the ORM objects I already have for it. > The DAL is not built for that. > Not sure what you mean. The DAL returns a Rows object. You can filter it with any simple or complex comparison you like. It even has a .find() method to simplify the process: db.Country(france).select().find(lambda r: r.Language != spanish and r. Population > 1000000) As for comparisons in Python, in web2py, you wouldn't be testing equality >> of a whole object/record -- typically it would be a scalar (e.g., the >> integer ID). >> > > That would still be much slower than an equality-test - especially for > large data-sets. > OK, please provide some benchmarks. What percentage decrease in CPU usage can we expect if we compare object identities rather than integer equivalencies? > And you wouldn't have multiple copies of records in memory either. >> >> > How so? > > If I do this: > > row1 = db.Country[1] > ... > row2 = db.Country[1] > And why are you doing that? Anthony -- --- 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.