for starters I'd combine "post_table" and "post_text_table" into  
one....not much is accomplished there by having two tables.  Also make  
sure forum_post.topic_id is indexed.


On Jun 5, 2008, at 1:37 PM, beewee wrote:

>
> Hi,
>
> we're writing a bulleting board using sqlalchemy at the moment, but we
> have the problem, that the database query for viewing a topic is quite
> slow for big topics.
> These are the relevant table definitions and mappings:
> http://paste.pocoo.org/show/62703/
> This is the query that is slow: http://paste.pocoo.org/show/62706/
> This is what EXPLAIN says: http://paste.pocoo.org/show/62708/
> Executing this query needs up to 25 seconds on our test server that's
> just idling. On our productive servers (which aren't idling, of
> course) phpbb is able to execute an adequate query much faster. May
> you can help us speeding up this query? I don't know what to improve,
> since all parts of the query already use a key (except the derived
> one), but unfortunately I have a quite small knowledge of improving
> database queries.
>
> Thank you very much,
>
> Benjamin Wiegand
>
> >


--~--~---------~--~----~------------~-------~--~----~
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 [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/sqlalchemy?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to