Giter Site home page Giter Site logo

very slow query about zoo-hacks HOT 5 OPEN

jbzoo-cck avatar jbzoo-cck commented on May 31, 2024
very slow query

from zoo-hacks.

Comments (5)

boomsya avatar boomsya commented on May 31, 2024

SELECT c.*, GROUP_CONCAT(DISTINCT ci.item_id) as item_ids FROM #__zoo_category AS c USE INDEX (APPLICATIONID_ID_INDEX) LEFT JOIN #__zoo_category_item AS ci ON ci.category_id = c.id LEFT JOIN #__zoo_item AS i USE INDEX (MULTI_INDEX2) ON ci.item_id = i.id AND i.state = 1 WHERE c.application_id = 2 AND c.published = 1

limit 2 = 0.2657 sec
limit 20 = 0.3786 sec
limit 100 = 0.3843 sec

from zoo-hacks.

boomsya avatar boomsya commented on May 31, 2024

without hacks:
SELECT c.*, GROUP_CONCAT(DISTINCT ci.item_id) as item_ids FROM ukr2y_zoo_category AS c USE INDEX (APPLICATIONID_ID_INDEX) LEFT JOIN ukr2y_zoo_category_item AS ci ON ci.category_id = c.id LEFT JOIN ukr2y_zoo_item AS i USE INDEX (MULTI_INDEX2) ON ci.item_id = i.id AND i.access IN(1, 5) AND i.state = 1 AND( i.publish_up = '0000-00-00 00:00:00' OR i.publish_up <= '2018-10-10 18:05:24') AND(i.publish_down = '0000-00-00 00:00:00' OR i.publish_down >= '2018-10-10 18:05:24')WHERE c.application_id = 2 AND c.published = 1 limit 200

limit 20 = 0.5215 sec
limit 200 = 0.4556 sec

from zoo-hacks.

boomsya avatar boomsya commented on May 31, 2024

when i replace GROUP_CONCAT(DISTINCT ci.item_id) as item_ids to "" as item_ids all fine
and pagination not disappear because public function getItems($published = false, $user = null, $orderby = '') check if items empty - then they get it in $this->app->table->item->getByCategory

from zoo-hacks.

CB9TOIIIA avatar CB9TOIIIA commented on May 31, 2024

when i replace GROUP_CONCAT(DISTINCT ci.item_id) as item_ids to "" as item_ids all fine
and pagination not disappear because public function getItems($published = false, $user = null, $orderby = '') check if items empty - then they get it in $this->app->table->item->getByCategory

Thank you for your interest. Do you have a better solution?

from zoo-hacks.

boomsya avatar boomsya commented on May 31, 2024

just replace GROUP_CONCAT(DISTINCT ci.item_id) as item_ids to "" as item_ids
visually no differences on site

from zoo-hacks.

Related Issues (1)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.