Closed timelabs-lucvt closed 4 months ago
Hi @timelabs-lucvt, MariaDB doesn't support multi-valued indexes, unfortunately.
@staudenmeir So is there any way to solve it other than changing the data structure?
There's no alternative that I know of.
Are you having performance issues?
That's right. I am querying for products that are not yet part of any promotions. And it's quite slow
What query are you running in this case?
In the product model I define the hasManyJson promotions relationship
and I use query
Did you already log the executed SQL and analyze it with EXPLAIN
?
Maybe you can improve the query performance with indexes on the time or status columns (if you haven't already). If the lookup in the product_ids
column is the actual bottleneck, I don't really see any solutions besides changing the data structure.
I have indexed the time and status but the query is still quite slow. I decided to change the data structure and it got better. Thanks for your support
I have a promotions table and a product_ids column containing a list of products. When I do a migration, I get the same error.
Is there any other way to fix it? Thank you!