Hello,
I'm assuming this is a ticket query. Looking at the source control
history it looks like this changed in #11140
http://trac.edgewall.org/ticket/11140
for 12.6, 1.0.2 and 1.1.2 because MySQL and SQLite limit in the number
of joins, and queries require too many.
If this is a common performance regression, maybe Trac could use joins
again if there are only a few custom fields.
Just out of curiosity, can you tell us what DB you are running? How
many tickets are there in total? How many matching this query?
On 24.06.2015 18:11, Lukasz Szybalski wrote:
Hello,
Can you tell me why trac 1.0.2 uses select from ticket_custom instead
of inner or left outer join?
This is a major performance hit. The query runs in 15seconds vs
0.05second with left outer join?
How can I change that?
SELECT t.id <http://t.id> AS id,t.summary AS summary,t.version AS
version,t.status AS status,t.priority AS priority,t.component AS
component,t.keywords AS keywords,t.time AS time,t.changetime AS
changetime,t.milestone AS milestone,
*(SELECT c.value FROM ticket_custom c WHERE c.ticket=t.id
<http://t.id> AND c.name <http://c.name>='contract_number') AS
`contract_number`*
FROM ticket AS t
LEFT OUTER JOIN ticket_custom c2
on c2.ticket=t.id <http://t.id>
and c2.name <http://c2.name>='contract_number'
LEFT OUTER JOIN enum AS priority ON (priority.type='priority' AND
priority.name <http://priority.name>=priority)
WHERE (t.status IN ('new','reopened') AND t.version NOT IN
('ILC','INC') AND (t.milestone='Endorsement'))
SELECT t.id <http://t.id> AS id,t.summary AS summary,t.version AS
version,t.status AS status,t.priority AS priority,t.component AS
component,t.keywords AS keywords,t.time AS time,t.changetime AS
changetime,t.milestone AS milestone, c2.value as contract_number
AS `contract_number`
FROM ticket AS t
* LEFT OUTER JOIN ticket_custom c2
on c2.ticket=t.id <http://t.id>
and c2.name <http://c2.name>='contract_number'
* LEFT OUTER JOIN enum AS priority ON (priority.type='priority' AND
priority.name <http://priority.name>=priority)
WHERE (t.status IN ('new','reopened') AND t.version NOT IN
('ILC','INC') AND (t.milestone='Endorsement'))
--
You received this message because you are subscribed to the Google
Groups "Trac Users" group.
To unsubscribe from this group and stop receiving emails from it, send
an email to [email protected]
<mailto:[email protected]>.
To post to this group, send email to [email protected]
<mailto:[email protected]>.
Visit this group at http://groups.google.com/group/trac-users.
For more options, visit https://groups.google.com/d/optout.
--
You received this message because you are subscribed to the Google Groups "Trac
Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/trac-users.
For more options, visit https://groups.google.com/d/optout.