Woah, 100 tables of users? That doesn't seem right. How come you don't just 
have 1 table, 'users', with an id column, and then each user is a row in the 
table?

Likewise for your events. Is there a reason you don't have a single 'events' 
table, with date as a column, and then each row in the table is an event?

I don't know about your slave question, perhaps Mike will.


-----Original Message-----
From: sqlalchemy@googlegroups.com [mailto:sqlalchemy@googlegroups.com] On 
Behalf Of Mason
Sent: Tuesday, 10 January 2012 1:08 PM
To: sqlalchemy
Subject: [sqlalchemy] sql hashed tables

Hi

I have 100 tables that go from user_00 to user_99 (based on the last 2
digits of user id).  In sql, I can create a view (say 'user') and
query 'user' directly.  With sqlalchemy, can I do something similar?
I would like to query the 'user' class directly, without having to
worry about which table to select from.  Also, if i have a sql table
that looks like event_20120109, and a new table is created everyday.
In the old way, i will need to figure out what table to query , do
'select * from event_201200109', and if not enough event, go 1 day in
the past, until i have enough events.  So, is there some way to query
specific table?  I know I can execute sql directly in sqlalchemy, but
want to see if there is smarter way to do it.  Last thing is, we like
to direct the select to a specific mysql salve based on table access.
For example, select * from table1 goes to slave1 and select * from
table2 goes to slave2.  Can sqlachemy be configured to go to specific
slave by examining the select on the fly?

Thanks,
Mason

-- 
You received this message because you are subscribed to the Google Groups 
"sqlalchemy" group.
To post to this group, send email to sqlalchemy@googlegroups.com.
To unsubscribe from this group, send email to 
sqlalchemy+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/sqlalchemy?hl=en.



-------------------------------------------------------------------------
DISCLAIMER: This e-mail transmission and any documents, files and 
previous e-mail messages attached to it are private and confidential.  
They may contain proprietary or copyright material or information that 
is subject to legal professional privilege.  They are for the use of 
the intended recipient only.  Any unauthorised viewing, use, disclosure, 
copying, alteration, storage or distribution of, or reliance on, this 
message is strictly prohibited.  No part may be reproduced, adapted or 
transmitted without the written permission of the owner.  If you have 
received this transmission in error, or are not an authorised recipient, 
please immediately notify the sender by return email, delete this 
message and all copies from your e-mail system, and destroy any printed 
copies.  Receipt by anyone other than the intended recipient should not 
be deemed a waiver of any privilege or protection.  Thales Australia 
does not warrant or represent that this e-mail or any documents, files 
and previous e-mail messages attached are error or virus free.  

-------------------------------------------------------------------------

-- 
You received this message because you are subscribed to the Google Groups 
"sqlalchemy" group.
To post to this group, send email to sqlalchemy@googlegroups.com.
To unsubscribe from this group, send email to 
sqlalchemy+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/sqlalchemy?hl=en.

Reply via email to