{"action":"created","issue":{"url":"https://api.github.com/repos/opensourcepos/opensourcepos/issues/1940","repository_url":"https://api.github.com/repos/opensourcepos/opensourcepos","labels_url":"https://api.github.com/repos/opensourcepos/opensourcepos/issues/1940/labels{/name}","comments_url":"https://api.github.com/repos/opensourcepos/opensourcepos/issues/1940/comments","events_url":"https://api.github.com/repos/opensourcepos/opensourcepos/issues/1940/events","html_url":"https://github.com/opensourcepos/opensourcepos/issues/1940","id":313558882,"number":1940,"title":"get_found_rows queries causing page load slowdown","user":{"login":"Ancient123","id":1577341,"avatar_url":"https://avatars0.githubusercontent.com/u/1577341?v=4","gravatar_id":"","url":"https://api.github.com/users/Ancient123","html_url":"https://github.com/Ancient123","followers_url":"https://api.github.com/users/Ancient123/followers","following_url":"https://api.github.com/users/Ancient123/following{/other_user}","gists_url":"https://api.github.com/users/Ancient123/gists{/gist_id}","starred_url":"https://api.github.com/users/Ancient123/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Ancient123/subscriptions","organizations_url":"https://api.github.com/users/Ancient123/orgs","repos_url":"https://api.github.com/users/Ancient123/repos","events_url":"https://api.github.com/users/Ancient123/events{/privacy}","received_events_url":"https://api.github.com/users/Ancient123/received_events","type":"User","site_admin":false},"labels":[{"id":67840975,"url":"https://api.github.com/repos/opensourcepos/opensourcepos/labels/enhancement","name":"enhancement","color":"84b6eb","default":true}],"state":"open","locked":false,"assignee":{"login":"daN4cat","id":636048,"avatar_url":"https://avatars1.githubusercontent.com/u/636048?v=4","gravatar_id":"","url":"https://api.github.com/users/daN4cat","html_url":"https://github.com/daN4cat","followers_url":"https://api.github.com/users/daN4cat/followers","following_url":"https://api.github.com/users/daN4cat/following{/other_user}","gists_url":"https://api.github.com/users/daN4cat/gists{/gist_id}","starred_url":"https://api.github.com/users/daN4cat/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/daN4cat/subscriptions","organizations_url":"https://api.github.com/users/daN4cat/orgs","repos_url":"https://api.github.com/users/daN4cat/repos","events_url":"https://api.github.com/users/daN4cat/events{/privacy}","received_events_url":"https://api.github.com/users/daN4cat/received_events","type":"User","site_admin":false},"assignees":[{"login":"daN4cat","id":636048,"avatar_url":"https://avatars1.githubusercontent.com/u/636048?v=4","gravatar_id":"","url":"https://api.github.com/users/daN4cat","html_url":"https://github.com/daN4cat","followers_url":"https://api.github.com/users/daN4cat/followers","following_url":"https://api.github.com/users/daN4cat/following{/other_user}","gists_url":"https://api.github.com/users/daN4cat/gists{/gist_id}","starred_url":"https://api.github.com/users/daN4cat/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/daN4cat/subscriptions","organizations_url":"https://api.github.com/users/daN4cat/orgs","repos_url":"https://api.github.com/users/daN4cat/repos","events_url":"https://api.github.com/users/daN4cat/events{/privacy}","received_events_url":"https://api.github.com/users/daN4cat/received_events","type":"User","site_admin":false}],"milestone":{"url":"https://api.github.com/repos/opensourcepos/opensourcepos/milestones/11","html_url":"https://github.com/opensourcepos/opensourcepos/milestone/11","labels_url":"https://api.github.com/repos/opensourcepos/opensourcepos/milestones/11/labels","id":2159680,"number":11,"title":"3.2.0","description":"","creator":{"login":"daN4cat","id":636048,"avatar_url":"https://avatars1.githubusercontent.com/u/636048?v=4","gravatar_id":"","url":"https://api.github.com/users/daN4cat","html_url":"https://github.com/daN4cat","followers_url":"https://api.github.com/users/daN4cat/followers","following_url":"https://api.github.com/users/daN4cat/following{/other_user}","gists_url":"https://api.github.com/users/daN4cat/gists{/gist_id}","starred_url":"https://api.github.com/users/daN4cat/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/daN4cat/subscriptions","organizations_url":"https://api.github.com/users/daN4cat/orgs","repos_url":"https://api.github.com/users/daN4cat/repos","events_url":"https://api.github.com/users/daN4cat/events{/privacy}","received_events_url":"https://api.github.com/users/daN4cat/received_events","type":"User","site_admin":false},"open_issues":2,"closed_issues":118,"state":"open","created_at":"2016-11-27T23:21:47Z","updated_at":"2018-04-12T21:14:45Z","due_on":"2018-04-15T07:00:00Z","closed_at":null},"comments":9,"created_at":"2018-04-12T02:55:22Z","updated_at":"2018-04-13T06:12:40Z","closed_at":null,"author_association":"NONE","body":"### Background information\r\n- [X] Reporting an issue of an unmodified OSPOS installation\r\n- [X] Checked [open and closed issues](https://github.com/opensourcepos/opensourcepos/issues?utf8=%E2%9C%93&q=is%3Aissue) and no similar issue was already reported (please make sure you searched!)\r\n- [X] Read [README](https://github.com/opensourcepos/opensourcepos/blob/master/README.md), [WHATS_NEW](https://github.com/opensourcepos/opensourcepos/blob/master/WHATS_NEW.txt), [INSTALL.md](https://github.com/opensourcepos/opensourcepos/blob/master/INSTALL.md) and [UPGRADE](https://github.com/opensourcepos/opensourcepos/blob/master/UPGRADE.txt)\r\n- [X] Read the [FAQ](https://github.com/opensourcepos/opensourcepos#faq) for any known install and/or upgrade gotchas (in specific PHP extensions installed)\r\n- [X] Read the [wiki](https://github.com/opensourcepos/opensourcepos/wiki)\r\n- [X] Executed any database upgrade scripts if an upgrade pre 3.0.0 (e.g. database/2.4_to_3.0.sql)\r\n- [X] Aware the installation code is in [bintray](https://bintray.com/jekkos/opensourcepos/opensourcepos/view/files?sort=updated&order=asc#files) (see README), and [GitHub master](https://github.com/opensourcepos/opensourcepos/tree/master) is for [developers only](https://github.com/opensourcepos/opensourcepos/wiki/Development-setup) and therefore not complete nor stable\r\n\r\n### Installation information\r\n\r\n- OSPOS version is:  3.1.1\r\n- PHP version is: 7.1\r\n- MySQL or MariaDB version is: 10.1\r\n- OS and version is: Ubuntu 17.10\r\n- WebServer is: nginx 1.12.1\r\n\r\n### Bug \r\n get_found_rows function is not performant and greatly slow down page load times in some instances.\r\n\r\nI am helping debug a friends deployment of opensourcepos and their item set is very large (56,000 items). I profiled the code and MySQL query logs and saw that the initial query for items is written with a limit statement, but then the get_found_rows call happens to get '$total_rows' and promptly grabs the entire result set (56,000 items).\r\n\r\nopensourcepos/application/controllers/Items.php line 61\r\n`$total_rows = $this->Item->get_found_rows($search, $filters);`\r\n\r\nThis should probably be replaced by a query with a simple `count` statement which would not return the entire result-set and would execute significantly faster when there are large result sets."},"comment":{"url":"https://api.github.com/repos/opensourcepos/opensourcepos/issues/comments/381034448","html_url":"https://github.com/opensourcepos/opensourcepos/issues/1940#issuecomment-381034448","issue_url":"https://api.github.com/repos/opensourcepos/opensourcepos/issues/1940","id":381034448,"user":{"login":"daN4cat","id":636048,"avatar_url":"https://avatars1.githubusercontent.com/u/636048?v=4","gravatar_id":"","url":"https://api.github.com/users/daN4cat","html_url":"https://github.com/daN4cat","followers_url":"https://api.github.com/users/daN4cat/followers","following_url":"https://api.github.com/users/daN4cat/following{/other_user}","gists_url":"https://api.github.com/users/daN4cat/gists{/gist_id}","starred_url":"https://api.github.com/users/daN4cat/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/daN4cat/subscriptions","organizations_url":"https://api.github.com/users/daN4cat/orgs","repos_url":"https://api.github.com/users/daN4cat/repos","events_url":"https://api.github.com/users/daN4cat/events{/privacy}","received_events_url":"https://api.github.com/users/daN4cat/received_events","type":"User","site_admin":false},"created_at":"2018-04-13T06:12:40Z","updated_at":"2018-04-13T06:12:40Z","author_association":"COLLABORATOR","body":"Yes, there's a mistake and I noticed late after I pushed the code. I'll fix it this eve.\nItems is not working as expected."}}
{"actor":{"display_login":"daN4cat"}}