Posts

R&D scenario step-by-step explain about Bloat

Image
  Step 1: Setting Up the Environment Objective: To set up a basic schema for a product review system. products Table: This table will store different product names. The id is an auto-incrementing primary key, ensuring each product has a unique identifier. reviews Table: This table stores reviews for the products. Each review is associated with a product through product_id (a foreign key). The created_at field automatically stores the timestamp of when a review was created. Step 2: Populating Data Objective: To insert sample data that mimics real-world usage. Inserting Products: Three products (Laptop, Smartphone, Headphones) are inserted into the products table. Bulk Insert of Reviews: A loop inserts 100,000 reviews for the first product (Laptop). This bulk insert simulates a large dataset, making it easier to observe bloat. Step 3: Simulating Bloat Objective: To generate bloat by performing numerous updates and deletions. Update Operations: Updating the first 50,000 rev...