Hi!

I have got, 3 tables in a Oracle database. I build the connection and 
everything. :-) When I generate a query from one table it is fast, really 
fast. But I created another query I use 3 tables, but only two is 
neccesseary. The "*Q*" connected the "*P*" and the "*C*" (one (*Q*) to many 
(*P*, *C*)), "*P*" and "*C*" haven't got connection.  
The query is something like this:
query_list = s.query(Q.id, C.mol_id, C.id, C.pc, C.poz, C.rown, C.col, C.
data1, C.data2, C.data3, C.data4, P.file, P.txtfile, P.date, P.mean, P.sd, P
.nmean, P.nsd, P.valid).join(P).join(C).filter(and_(P.ca_id == 13, C.pc != 
'!!!!!!!!', P.valid == 1, )).all()

I have got two problems:
1. Running time these script is 13-6 minutes! (yes, miniutes) I printed to 
the screen. There is any (much) faster solution? (rows number in the end 
20000-100000 - depends the parameters)
2. Can I skip somehow the "Q" table columns from the query, or at least 
from the returned datas? The others is necessary columns.
(bonus) 3. If, I  send Pandas dataframe or Numpy matrix, or json dataformat 
and read these data is faster?

Any idea for faster method?

best,
Attila

-- 
SQLAlchemy - 
The Python SQL Toolkit and Object Relational Mapper

http://www.sqlalchemy.org/

To post example code, please provide an MCVE: Minimal, Complete, and Verifiable 
Example.  See  http://stackoverflow.com/help/mcve for a full description.
--- 
You received this message because you are subscribed to the Google Groups 
"sqlalchemy" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to sqlalchemy+unsubscr...@googlegroups.com.
To post to this group, send email to sqlalchemy@googlegroups.com.
Visit this group at https://groups.google.com/group/sqlalchemy.
For more options, visit https://groups.google.com/d/optout.

Reply via email to