DAL - No Index Tables?

Hello,

do I understand it correct that you do not have dedicated index tables in shopware 6?

Because I executed bin/console dal:refresh:index and was searching in the db for some index tables.

Then I checked some command and only see that you update some columns in the normal table.

Is that correct? How can I as developer know which column is used from an index?

Greetings,
Björn

Hi Björn,

I’m just not sure what exactly you mean by index tables or index columns. If by this you mean columns or tables that are filled automatically - Yes, there are.

We have certain columns in the tables (product.listing_prices, rule.payload for example) which are automatically set by the system.

However, there are also denormalized tables that are automatically filled by the dal:refresh:index process.
You can recognize these columns by the corresponding entity definition, because these associations or columns are marked with a WriteProcted() flag.

* https://github.com/shopware/platform/blob/master/src/Core/Content/Product/ProductDefinition.php#L167

* https://github.com/shopware/platform/blob/master/src/Core/Content/Rule/RuleDefinition.php#L66
 

1 „Gefällt mir“

Thx for your feedback, this helps me to understand it Wink

It is a bit sad that I can not see in the db directly if the column is write- and/or read-protected.

So from my point of view it would be cool to have some consistent suffix that tell you that also when you just check the tables.