Ticket #5645 (closed defect: fixed)

Opened 3 years ago

Last modified 2 years ago

DiscussionPlugin: no index on column time in tables

Reported by: ThurnerRupert Assigned to: Blackhex
Priority: normal Component: DiscussionPlugin
Severity: normal Keywords:
Cc: Trac Release: 0.11

Description

clicking on the timeline queries tables by time, but there is no index. if the table gets larger, this might slow down the query.

2009-08-09 06:44:50,720 Trac[main] DEBUG: Dispatching <Request "GET u'/timeline'">
2009-08-09 06:44:50,799 Trac[session] DEBUG: Retrieving session for ID 'rupert.thurner'
2009-08-09 06:44:50,819 Trac[chrome] DEBUG: Prepare chrome data for request
2009-08-09 06:44:50,897 Trac[model] DEBUG: get_blog_posts() SQL: 'SELECT bp1.name, bp1.version, bp1.publish_time, bp1.author, bp1.title, bp1.body, bp1.categories FROM fullblog_posts bp1 WHERE bp1.version_time>%s AND bp1.version_time<%s ORDER BY bp1.publish_time DESC' ((1241992799, 1249855199))
2009-08-09 06:44:50,920 Trac[model] DEBUG: get_blog_comments() SQL: 'SELECT name, number, comment, author, time FROM fullblog_comments WHERE time>%s AND time<%s' ((1241992799, 1249855199))
2009-08-09 06:44:58,441 Trac[timeline] DEBUG: start: 2009-05-10 23:59:59.812740+02:00, stop: 2009-08-09 23:59:59.812740+02:00, filters: ['blog', 'milestone', 'ticket', 'changeset', 'wiki', 'discussion']
2009-08-09 06:44:58,444 Trac[timeline] DEBUG: SELECT f.id, f.name, f.author, f.subject, f.description, f.time FROM forum f WHERE f.time BETWEEN 2009-05-10 23:59:59.812740+02:00 AND 2009-08-09 23:59:59.812740+02:00
2009-08-09 06:44:58,453 Trac[timeline] DEBUG: SELECT t.id, t.subject, t.body, t.author, t.time, t.forum, f.name FROM topic t LEFT JOIN (SELECT id, name FROM forum) f ON t.forum = f.id WHERE t.time BETWEEN 2009-05-10 23:59:59.812740+02:00 AND 2009-08-09 23:59:59.812740+02:00
2009-08-09 06:44:58,478 Trac[timeline] DEBUG: SELECT m.id, m.author, m.time, m.forum, m.topic, m.body, f.name, t.subject FROM message m, (SELECT id, name FROM forum) f, (SELECT id, subject FROM topic) t WHERE t.id = m.topic AND f.id = m.forum AND time BETWEEN 2009-05-10 23:59:59.812740+02:00 AND 2009-08-09 23:59:59.812740+02:00

Attachments

Change History

08/10/09 05:44:32 changed by anonymous

  • summary changed from dicussion, no index on column time in tables to DiscussionPlugin: no index on column time in tables.

08/10/09 21:28:53 changed by Blackhex

  • status changed from new to assigned.

I think that creating indices for DB is sever administrator choice.

04/29/10 15:08:26 changed by Blackhex

  • status changed from assigned to closed.
  • resolution set to fixed.

Added to r7899.


Add/Change #5645 (DiscussionPlugin: no index on column time in tables)




Change Properties
Action