Skip to content
This repository has been archived by the owner on Dec 13, 2022. It is now read-only.

Optimize logs table request #4633

Closed
garnier-quentin opened this issue Aug 25, 2016 · 1 comment · May be fixed by rc042/centreon#159, rc042/centreon#166, rc042/centreon#181 or rc042/centreon#186
Closed

Optimize logs table request #4633

garnier-quentin opened this issue Aug 25, 2016 · 1 comment · May be fixed by rc042/centreon#159, rc042/centreon#166, rc042/centreon#181 or rc042/centreon#186
Assignees
Labels
kind/enhancement status/implemented status/in-backlog A dev will begin to work on your modifications soon
Milestone

Comments

@garnier-quentin
Copy link
Contributor


BUG REPORT INFORMATION

Centreon Web version: 2.7.6

Steps to reproduce the issue:

  1. Go to the log page

Describe the results you received:
It does following request (a full scan):
SELECT SQL_CALC_FOUND_ROWS DISTINCT logs.* FROM logs WHERE logs.ctime > '1466936710' AND (( (msg_type = '2' AND status IN ('0','1','2','3'))) OR ( ((msg_type IN ('0', '10', '11') AND status IN ('0','1','2','3')) ) )) AND msg_type NOT IN ('4','5') ORDER BY ctime DESC, host_name ASC, log_id DESC, service_description ASC LIMIT 0, 30;

Describe the results you expected:
I think we can removed following order by 'host_name ASC, log_id DESC, service_description ASC'. time is enough.
The DISTINCT could be removed when we don't use ACL. DISTINCT has a purpose only with ACL stuffs.

Additional information you think important (e.g. issue happens only occasionally):

julienmathis added a commit that referenced this issue Sep 5, 2016
@julienmathis julienmathis added this to the 2.8.0 milestone Sep 5, 2016
@julienmathis julienmathis self-assigned this Sep 5, 2016
@garnier-quentin
Copy link
Contributor Author

Thanks. But you haven't changed the ORDER BY.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.