How product images are saved in database Magento 2?

A Product is the main entity for any e-Commerce system, A product has multiple information like Title, SKU, Inventory, Images and so more.

Let’s Start with the Main point, A product has multiple images available and we want to know how each product are stored in the database.

catalog_product_entity_varchar used for store product images value.

Continue reading “How product images are saved in database Magento 2?”

How to add Index to table column using Magento 2?

You can create your column as index key for better performance and speedy retrieval of data from a table.

An index is a performance optimization feature that enables data to be accessed faster compare to other nonindex columns. An index is used to more quickly find rows in the table based on the values which are part of the index and they don’t define the uniqueness of a column.

You can add your column as Index key using Magento 2 by below way using InstallSchema or UpgradeSchema.php file,

Here table_name is your table name of database and table_field is your field which you want to create index key.
You can check blog for Add foreign key to table, Add Foreign key to table using Magento 2