[sqlalchemy] Re: Insert through ORM performance (was: Performance question)

2007-08-23 Thread Glauco
CUT thats because SA still does a lot of work on each batch of {params} to check for defaults and also to process bind parameters. We might look into optimizing some of the redundant work which occurs within this process in 0.4, however as long as people still want their unicodes

[sqlalchemy] Re: How can I do join on a self-referential m2m relation?

2007-08-23 Thread Jian Luo
I tried depth 4, with fine gain control using eagerload_all options. That works! Cool! Thanks again for the great job! Best Jian On Aug 22, 10:38 pm, Michael Bayer [EMAIL PROTECTED] wrote: Hi Jian - yes, its the PropertyAliasedClauses. I put in a fix + a test based on your example in

[sqlalchemy] Re: Insert through ORM performance (was: Performance question)

2007-08-23 Thread Glauco
So, if you truly want DBAPI-speed inserts, use the raw connection: engine.connect().connection.executemany(your statement, [{params1}, {params2}, {params3}, ...]) Wow.. after some try i found this is enought fast for me.. engine.connect().execute(sql,list_qry_params ) direct

[sqlalchemy] between_op() error with property expressions: is this a bug?

2007-08-23 Thread stephen emslie
I'm using the new property-based query expressions to create a between clause to filter on: MappedClass.age.between(1,2) This produces (on alchemy 0.4 beta4.): *** TypeError: between_op() takes exactly 2 arguments (3 given) Is this a bug, or should I not be using a property-based expression

[sqlalchemy] Re: between_op() error with property expressions: is this a bug?

2007-08-23 Thread Michael Bayer
sounds like a bug. for now, call it from the Column object: MappedClass.c.age.between(1,2) (that should work). On Aug 23, 2007, at 6:03 AM, stephen emslie wrote: I'm using the new property-based query expressions to create a between clause to filter on: MappedClass.age.between(1,2)

[sqlalchemy] sql executemany and postgresql - probably bug

2007-08-23 Thread che
Hi, i tried suggested in other thread way of inserting many records into database table and it raised exception against postgres (psycopg2) using the latest trunk (r3412) of SA. Then i checked that in version 0.3.10 same(analogical) code works. Please tell me if there is something wrong with my

[sqlalchemy] Re: sql executemany and postgresql - probably bug

2007-08-23 Thread Michael Bayer
dont compile() the insert statement yourself here; since you are only executing it once, theres nothing to be gained by manually compiling first. Its also the source of the error. the issue is that when the Insert is compiled with no values clause, it produces column entries for all

[sqlalchemy] Re: sql executemany and postgresql - probably bug

2007-08-23 Thread che
Hi, On 23 Авг, 17:47, Michael Bayer [EMAIL PROTECTED] wrote: dont compile() the insert statement yourself here; since you are only executing it once, theres nothing to be gained by manually compiling first. this was the minimal code demonstrating the issue. i planned to do this many times for

[sqlalchemy] Re: sql executemany and postgresql - probably bug

2007-08-23 Thread Glauco
seems there is some other prob too: - in 0.3 it is issued 2 statements: select nextval('Manager_id_seq') and then: INSERT INTO Manager (duties, name, id) VALUES (%(duties)s, %(name)s, %(id)s) with the ids got from the db and the other parameters. - in 0.4 it is issued only the last

[sqlalchemy] Re: between_op() error with property expressions: is this a bug?

2007-08-23 Thread Paul Johnston
Hi, sounds like a bug. for now, call it from the Column object: MappedClass.c.age.between(1,2) (that should work). There seems to be a bug in sql/operators.py - between only has two arguments, not three. I've hit this as well. Paul --~--~-~--~~~---~--~~

[sqlalchemy] Autoload errors

2007-08-23 Thread Mike Orr
I'm upgrading a Pylons app from SQLAlchemy 0.3 to 0.4. One table is defined as: incidents = Table(IN_Incident, meta, Column(orr_id, Integer, primary_key=True), autoload=True, autoload_with=engine) The table is a MySQL VIEW that contains a column 'is_top'. The application fails because

[sqlalchemy] Re: Autoload errors

2007-08-23 Thread jason kirtland
Mike wrote: I'm upgrading a Pylons app from SQLAlchemy 0.3 to 0.4. One table is defined as: incidents = Table(IN_Incident, meta, Column(orr_id, Integer, primary_key=True), autoload=True, autoload_with=engine) The table is a MySQL VIEW that contains a column 'is_top'. MySQL

[sqlalchemy] Join in where and using .join()

2007-08-23 Thread Arun Kumar PG
Guys, Quick clarification: If we have two tables A and B with relationship keys 'XYZ' in both (B references A) then which is faster: 1) session.query(A).select_by(*[A.c.XYZ == B.c.XYZ]) or 2) session.query(A, B).join('XYZ') 2 should be faster as 1 may require more row scans ? Also, the