Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Loading Only Metas that were asked for#544

Open
Stevemoretz wants to merge 2 commits intocorcel:5.0from
Stevemoretz:5.0
Open

Loading Only Metas that were asked for#544
Stevemoretz wants to merge 2 commits intocorcel:5.0from
Stevemoretz:5.0

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.

3 participants