Catalog Database Structure

The Catalog module is the core of Magento's product management system. It stores all product, category, and attribute information. This module primarily uses the EAV (Entity-Attribute-Value) pattern, which allows for flexible attribute management but creates a more complex database structure.

Key Relationships

Catalog Tables Relationships

Note: This is a simplified diagram showing the main relationships.

Understanding EAV Structure

  • The main entity tables (like catalog_product_entity) only store basic entity information
  • Actual attribute values are stored in separate value tables based on data type (varchar, int, decimal, text, datetime)
  • To get complete product information, you need to join multiple tables

Product Tables

catalog_product_entity

The main product entity table. Each row represents a unique product in the system.

ColumnTypeDescription
entity_idintPrimary key
skuvarcharProduct SKU (Stock Keeping Unit)
type_idvarcharProduct type (simple, configurable, bundle, etc.)
attribute_set_idsmallintForeign key to eav_attribute_set.attribute_set_id
created_attimestampWhen the product was created
updated_attimestampWhen the product was last updated

catalog_product_entity_* (EAV Value Tables)

These tables store the actual attribute values for products. There are separate tables for different data types.

TableData TypeExample Attributes
catalog_product_entity_varcharString valuesname, url_key, image, thumbnail
catalog_product_entity_intInteger valuesstatus, visibility, tax_class_id
catalog_product_entity_decimalDecimal valuesprice, special_price, weight
catalog_product_entity_textLong text valuesdescription, short_description
catalog_product_entity_datetimeDate/time valuesspecial_from_date, special_to_date

Category Tables

catalog_category_entity

The main category entity table. Each row represents a category in the catalog.

ColumnTypeDescription
entity_idintPrimary key
parent_idintParent category ID (forms a tree structure)
pathvarcharPath from root category (e.g., "1/2/3")
positionintPosition within parent category
levelintDepth in category tree (root = 0)
created_attimestampWhen the category was created
updated_attimestampWhen the category was last updated

catalog_category_product

Maps products to categories (many-to-many relationship).

ColumnTypeDescription
entity_idintPrimary key
category_idintForeign key to catalog_category_entity.entity_id
product_idintForeign key to catalog_product_entity.entity_id
positionintProduct position within category

Product Relationship Tables

catalog_product_relation

Stores relationships between parent and child products (e.g., configurable products and their simple variants).

ColumnTypeDescription
parent_idintForeign key to catalog_product_entity.entity_id (parent product)
child_idintForeign key to catalog_product_entity.entity_id (child product)

catalog_product_link

Stores product links (related, up-sell, cross-sell, etc.).

ColumnTypeDescription
link_idintPrimary key
product_idintForeign key to catalog_product_entity.entity_id (source product)
linked_product_idintForeign key to catalog_product_entity.entity_id (target product)
link_type_idsmallintType of link (1=related, 4=up-sell, 5=cross-sell)

Price Tables

catalog_product_index_price

Indexed product prices for faster catalog browsing. This is a denormalized table for performance.

ColumnTypeDescription
entity_idintForeign key to catalog_product_entity.entity_id
customer_group_idsmallintCustomer group ID
website_idsmallintWebsite ID
pricedecimalBase price
final_pricedecimalFinal price after discounts
min_pricedecimalMinimum price (for configurable products)
max_pricedecimalMaximum price (for configurable products)

Data Analysis Tips

  • For basic product information, use EAV joins on value tables.
  • For product-category relationships, join catalog_category_product with catalog_category_entity and catalog_product_entity.
  • For price analysis, use catalog_product_index_price for better performance.