Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
O
osticket
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container registry
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
docker
osticket
Commits
8540d287
Commit
8540d287
authored
9 years ago
by
Jared Hancock
Browse files
Options
Downloads
Patches
Plain Diff
Revert "db: Fix ticket queue counts for large datasets"
This reverts commit
c4ace2d5
.
parent
0ec7cf62
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
include/staff/tickets.inc.php
+11
-10
11 additions, 10 deletions
include/staff/tickets.inc.php
with
11 additions
and
10 deletions
include/staff/tickets.inc.php
+
11
−
10
View file @
8540d287
...
@@ -291,16 +291,17 @@ while ($row = db_fetch_array($res)) {
...
@@ -291,16 +291,17 @@ while ($row = db_fetch_array($res)) {
// Fetch attachment and thread entry counts
// Fetch attachment and thread entry counts
if
(
$results
)
{
if
(
$results
)
{
$counts_sql
=
'SELECT ticket.ticket_id, coalesce(attach.count, 0) as attachments, '
$counts_sql
=
'SELECT ticket.ticket_id,
.
'coalesce(thread.count, 0) as thread_count, coalesce(collab.count, 0) as collaborators '
count(DISTINCT attach.attach_id) as attachments,
.
'FROM '
.
TICKET_TABLE
.
' ticket '
count(DISTINCT thread.id) as thread_count,
.
'left join (select count(attach.attach_id) as count, ticket_id from '
.
TICKET_ATTACHMENT_TABLE
count(DISTINCT collab.id) as collaborators
.
' attach group by attach.ticket_id) as attach on (attach.ticket_id = ticket.ticket_id) '
FROM '
.
TICKET_TABLE
.
' ticket
.
'left join (select count(thread.id) as count, ticket_id from '
.
TICKET_THREAD_TABLE
LEFT JOIN '
.
TICKET_ATTACHMENT_TABLE
.
' attach ON (ticket.ticket_id=attach.ticket_id) '
.
' thread group by thread.ticket_id) as thread on (thread.ticket_id = ticket.ticket_id) '
.
' LEFT JOIN '
.
TICKET_THREAD_TABLE
.
' thread ON ( ticket.ticket_id=thread.ticket_id) '
.
'left join (select count(collab.id) as count, ticket_id from '
.
TICKET_COLLABORATOR_TABLE
.
' LEFT JOIN '
.
TICKET_COLLABORATOR_TABLE
.
' collab
.
' collab group by collab.ticket_id) as collab on (collab.ticket_id = ticket.ticket_id) '
ON ( ticket.ticket_id=collab.ticket_id) '
.
' WHERE ticket.ticket_id IN ('
.
implode
(
','
,
db_input
(
array_keys
(
$results
)))
.
');'
;
.
' WHERE ticket.ticket_id IN ('
.
implode
(
','
,
db_input
(
array_keys
(
$results
)))
.
')
GROUP BY ticket.ticket_id'
;
$ids_res
=
db_query
(
$counts_sql
);
$ids_res
=
db_query
(
$counts_sql
);
while
(
$row
=
db_fetch_array
(
$ids_res
))
{
while
(
$row
=
db_fetch_array
(
$ids_res
))
{
$results
[
$row
[
'ticket_id'
]]
+=
$row
;
$results
[
$row
[
'ticket_id'
]]
+=
$row
;
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment