Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Loading Only Metas that were asked for #544

Open
wants to merge 2 commits into
base: 5.0
Choose a base branch
from
Open

Loading Only Metas that were asked for #544

wants to merge 2 commits into from

Conversation

Stevemoretz
Copy link

As I saw a problem in #543 I went and fixed it myself.

@Stevemoretz
Copy link
Author

I don't understand what could possibly go wrong I changed one line of code only.

@jgrossi
Copy link
Member

jgrossi commented Dec 29, 2020

Hey! It seems the code style is not according to PSR2

@Stevemoretz
Copy link
Author

Hey.

if ($meta = $this->meta()->where('meta_key',$attribute)->value('meta_value')) {

Here's the code.Could you be more specific?
I still don't know what's wrong.

@bellwood
Copy link

Here's the code.Could you be more specific?

As per PSR-2

Code MUST use 4 spaces for indenting, not tabs.

You've got a mix of spaces and tabs in your PR

@Stevemoretz
Copy link
Author

Oh cool thanks for clarification.
I guess using the metas like this are not a good idea anyways.

My solution does make a lot of queries.
The main solution did make one query that got all the meta.

I did try caching on both and the results are still slow.

So I switched to other solutions like using with and with where condition to only get the metas that we need.

With only makes one query and it's the best for performance reasons also can be used on many rows and still so fast.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants