Comments (10)
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.
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.
Can you post the migration of server_stats
or its table structure in the database (with indexes)?
from eloquent-eager-limit.
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.
Please add an index to server_id
and try again.
from eloquent-eager-limit.
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
from eloquent-eager-limit.
Could you send me a dump of the whole table or does it contain any sensitive data?
from eloquent-eager-limit.
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.
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.
Thank you for your effort and time :)
from eloquent-eager-limit.
Related Issues (20)
- Your requirements could not be resolved to an installable set of packages HOT 2
- SQLSTATE[42000]: Syntax error or access violation: 1140 Mixing of GROUP columns (MIN(),MAX(),COUNT(),...) HOT 5
- Doesn't work on MariaDB 10.6.4 without disabling strict mode
- Doesn't work on MariaDB 10.6.4 without disabling strict mode HOT 1
- Incompatible with jordanmiguel/laravel-popular using Mysql 8 HOT 3
- Not working withCount HOT 3
- Trait "Staudenmeir\EloquentEagerLimit\HasEagerLimit" not found HOT 3
- What's the difference between this and Laravel implementation HOT 1
- Collision with 'laravel-relationship-events' package HOT 1
- Using a Lateral join HOT 2
- Collision with 'laravel-eloquent-query-cache' package HOT 2
- The performace is awful HOT 1
- Conflit with Compoships.
- Conflit with Compoships package HOT 2
- Laravel 10 Breaking Change HOT 1
- Just a question about the generated query HOT 2
- HasEagerLimit trait conflicts with HasJsonRelationships HOT 7
- Call to undefined method Illuminate\Database\Eloquent\Builder::groupLimit() HOT 1
- Collision with compoships HOT 1
- Interest in integrating into Laravel 11? HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from eloquent-eager-limit.