Giter Site home page Giter Site logo

Comments (10)

staudenmeir avatar staudenmeir commented on August 17, 2024

Can you run EXPLAIN with the last query?

How many records does server_stats have per server_id (on average)?

Have you tried the query without the limit?

from eloquent-eager-limit.

igunultas avatar igunultas commented on August 17, 2024

Here is the EXPLAIN result
Screen Shot 2020-03-17 at 18 04 57

well i just deleted unnecessary rows in order to reduce query timing but not effected the way it works, most likely right know 60K rows for each server_id

without limit server drops connection :P i think its related to my database not to package :(

from eloquent-eager-limit.

staudenmeir avatar staudenmeir commented on August 17, 2024

Can you post the migration of server_stats or its table structure in the database (with indexes)?

from eloquent-eager-limit.

igunultas avatar igunultas commented on August 17, 2024

of course

here is the migration

 public function up()
    {
        Schema::create('server_stats', function (Blueprint $table) {
            $table->bigIncrements('id');
            $table->integer("server_id");
            $table->json("cpu");
            $table->json("ram");
            $table->json("swap");
            $table->json("disk");
            $table->json("network");
            $table->json("cpustats");
            $table->timestamps();
        });
    }

from eloquent-eager-limit.

staudenmeir avatar staudenmeir commented on August 17, 2024

Please add an index to server_id and try again.

from eloquent-eager-limit.

igunultas avatar igunultas commented on August 17, 2024

I did here is the explain result and the query still takes 1 min 3 seconds

if you want to dig deeper you can connect my computer over anydesk or teamviewer

Screen Shot 2020-03-17 at 18 32 20

from eloquent-eager-limit.

staudenmeir avatar staudenmeir commented on August 17, 2024

Could you send me a dump of the whole table or does it contain any sensitive data?

from eloquent-eager-limit.

igunultas avatar igunultas commented on August 17, 2024

DATA REMOVED FOR PRIVACY

here is the data of server_stats table

i would love to send servers table as well but it contains sensetive data

there is 10 rows in servers table from (1 to 10). 9 does not have any information in server_stats table.

from eloquent-eager-limit.

staudenmeir avatar staudenmeir commented on August 17, 2024

I've looked into it, but I couldn't figure out why MariaDB isn't using the index.

Since this is the standard implementation of such a query, the issue is not caused by the package.

I suggest that you ask a question on Stack Overflow.

from eloquent-eager-limit.

igunultas avatar igunultas commented on August 17, 2024

Thank you for your effort and time :)

from eloquent-eager-limit.

Related Issues (20)

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.