Hi all,
I am having trouble deferring a many-to-many mapping. I just had a couple
of questions related there-to:
(1) The most visible implementations of vanilla many-to-many mappings seem
to use sqlalchemy.Table(...). Is that, indeed, the accepted practice? One
alternative would be to use a ma
On Sep 12, 2014, at 12:26 PM, Matthijs Blaas wrote:
> > set the search path within the connection pool using the "connect" event;
> > all connections used by the pool will then have this search path setting
> > the moment they connect. Don't ever put multiple SQL expressions in a DBAPI
> > ex
I think you need to profile the application like Mike said. Just to be
thorough, I'd suggest you time the Query execution and the ORM population.
Do you have an example of the faster raw SQL that you're trying to generate
?
When you do a query on the commandline it is often faster because the
> set the search path within the connection pool using the “connect” event;
all connections used by the pool will then have this search path setting
the moment they connect. Don’t ever put multiple SQL expressions in a DBAPI
execute (for this very reason - driver changes, hilarity ensues. We are
i have no input on the issues michael identified.
but i'm curious about a sqlalchemy event somehow not firing. which
transaction event were you using? after_begin or after_transaction_create
?
--
You received this message because you are subscribed to the Google Groups
"sqlalchemy" grou
On Sep 12, 2014, at 6:45 AM, Matthijs Blaas wrote:
> Ok, i found the issue!
>
> When I tried to use pg8000 to connect to postgres i got an error: "cannot
> insert multiple commands into a prepared statement".
> Apparently multiple queries is fine with psycopg2, but not using pg8000.
>
> We pr
OK, keep going with the profiling, whats the total number of rows you are
seeing with the joined load, 5000 total ? sometimes a join is actually
scrolling through many more rows than that, duplicate rows in the case of a
cartesian product.echo='debug' would show that. Or there could be v
Ok, i found the issue!
When I tried to use pg8000 to connect to postgres i got an error: "cannot
insert multiple commands into a prepared statement".
Apparently multiple queries is fine with psycopg2, but not using pg8000.
We prefix all queries because of a workaround. We handle multi-tenancy
u
Thats what I did before, activating echo=True shows me correct query too.
This joinedload takes 1.3 seconds for this 5000 entries.
And only 4 queries in general for complete side load. Adding one more
joinedload ends up in 2 seconds, thats way too much for 1700 customers and
5 k bought items
On Th