Skip to content

Conversation

@Jade-GG
Copy link
Collaborator

@Jade-GG Jade-GG commented Jul 24, 2025

See #942, this is my alternative version, which includes attribute options and uses joins for attribute data & option values (but a relation for the options themselves).

Based on better benchmarks and cleaner relations, we have chosen to keep this approach as opposed to #942. I've taken some of the extra functionality from there and have implemented into this PR.


With this PR we end up having 13 queries in total for products (regardless of how many products you query):

  • 1 for the product itself
  • 1 for the stock status
  • 1 for the super attributes
  • 2 for the category info (do we need this eager loaded?)
  • 5 for each type of entity value
  • 3 for the option relations, as 3 of the types (int, varchar, text) could have a custom option value, as far as I'm aware.

I've also made a small backend_model thing to parse data that may be in a weird format but I don't really know if this is a worthwhile thing to have abstracted like this. This is currently only used for comma separated values.

This also includes #944 currently, to add support for querying based on attributes. This is necessary to filter products based on the status attribute.


Current to do list:

  • Optimizations where possible
  • Functionality that came from the scopes
    • Super attributes
    • Stock information
    • Upsells
    • Grouped products
    • Category information
    • Selecting for specific use cases, e.g. selectForProductPage
  • Attributes
    • URL attribute
    • Images (all types)
    • Special price
    • Price (including configurable and grouped products)
    • Min sale qty
    • Breadcrumbs
  • Relations
    • Product options
    • categoryProducts (is this necessary?)
    • reviewSummary (is this necessary?)
  • Package updates
    • rapidez/reviews
    • ...finish this list
  • Check the data that enters the indexer
  • Optimize the indexer data because it is currently unacceptably slow
  • Tier pricing
  • Update and fix unit tests
  • Compatibility with Runway
  • Frontend
    • Update product page
    • Super attributes on product listing page combined with swatch filters
    • ...finish this list
  • Super attributes but actually working
  • Retrieving children (especially when needed in the indexer) is incredibly slow
  • Anything else I'm missing? Test everything and finish this list

@Jade-GG Jade-GG changed the title [4.x] Implement EAV structure for product entity Implement EAV structure for product entity Aug 6, 2025
@royduin royduin changed the title Implement EAV structure for product entity Use EAV structure instead of flat tables Nov 14, 2025
@royduin royduin marked this pull request as ready for review November 14, 2025 10:33
@royduin royduin requested a review from indykoning as a code owner November 14, 2025 10:33
@royduin royduin merged commit e46a438 into master Nov 14, 2025
6 of 20 checks passed
@royduin royduin deleted the feature/flat-tables branch November 14, 2025 10:34
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