Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. Database & SysAdmin
  3. Database
  4. Database Design For Multiple Product Types

Database Design For Multiple Product Types

Scheduled Pinned Locked Moved Database
databasehelpdesignperformance
5 Posts 4 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • M Offline
    M Offline
    Member 7702110
    wrote on last edited by
    #1

    I have a database containing different product types. Each type contains field that differs greatly with each other. The first type of product, is classified in three categories. The second type of product, is classified in three categories. But the third and the fourth one, is not classified in anything. Each product can have any number of different properties. I have a huge database,which containing about 500000 product in product table. So when I am going to fetch a product from database with all its attributes, or going to search product filtering by attributes, it makes effect on performance badly. Could any one can help me what will be the tables structure in sql or do some more indexing or any feasible solution for this problem. Because different ecommerce sites are using this kind of database and working fine with huge different types of products.

    L D 3 Replies Last reply
    0
    • M Member 7702110

      I have a database containing different product types. Each type contains field that differs greatly with each other. The first type of product, is classified in three categories. The second type of product, is classified in three categories. But the third and the fourth one, is not classified in anything. Each product can have any number of different properties. I have a huge database,which containing about 500000 product in product table. So when I am going to fetch a product from database with all its attributes, or going to search product filtering by attributes, it makes effect on performance badly. Could any one can help me what will be the tables structure in sql or do some more indexing or any feasible solution for this problem. Because different ecommerce sites are using this kind of database and working fine with huge different types of products.

      L Offline
      L Offline
      Lost User
      wrote on last edited by
      #2

      Member 7702110 wrote:

      Because different ecommerce sites are using this kind of database and working fine with huge different types of products.

      That's not due to a "single" thing, it requires a lot of things to be checked. 500.000 items isn't much. A normalized design (upto BCNF, see wikipedia) would, IMHO, be the best startingpoint. Next, you'd need to determine indexes. You'd also need to optimize the calls you make to the database - a rewrite of the SQL statement can often improve it's performance. ..and do check the health of database-server once in a while; is the database fragmented? Latest Service Pack installed? Enough memory?

      Bastard Programmer from Hell :suss: If you can't read my code, try converting it here[^]

      1 Reply Last reply
      0
      • M Member 7702110

        I have a database containing different product types. Each type contains field that differs greatly with each other. The first type of product, is classified in three categories. The second type of product, is classified in three categories. But the third and the fourth one, is not classified in anything. Each product can have any number of different properties. I have a huge database,which containing about 500000 product in product table. So when I am going to fetch a product from database with all its attributes, or going to search product filtering by attributes, it makes effect on performance badly. Could any one can help me what will be the tables structure in sql or do some more indexing or any feasible solution for this problem. Because different ecommerce sites are using this kind of database and working fine with huge different types of products.

        D Offline
        D Offline
        David Mujica
        wrote on last edited by
        #3

        Consider a parent table which contains all of the fields that are common to every product. (Ex: ProductID and Description, etc) then create a child table which contains all of the varying attributes which make up the product. The structure would be something like (ProductID, AttributeName, AttributeValue) Example: 100,Color,Black 100,KosherCertified,False 100,InsuranceValue,123.99 A structure like this gives you the maximum flexibility for storing varying attributes for each one of your Products. Just an idea. :java:

        J 1 Reply Last reply
        0
        • D David Mujica

          Consider a parent table which contains all of the fields that are common to every product. (Ex: ProductID and Description, etc) then create a child table which contains all of the varying attributes which make up the product. The structure would be something like (ProductID, AttributeName, AttributeValue) Example: 100,Color,Black 100,KosherCertified,False 100,InsuranceValue,123.99 A structure like this gives you the maximum flexibility for storing varying attributes for each one of your Products. Just an idea. :java:

          J Offline
          J Offline
          Jorgen Andersson
          wrote on last edited by
          #4

          And AttributeType, so you can cast the attribute to the right type. And then normalize the Attribute and AttributeType into its own table. Just my $0.02

          Be excellent to each other. And... PARTY ON, DUDES! Abraham Lincoln

          1 Reply Last reply
          0
          • M Member 7702110

            I have a database containing different product types. Each type contains field that differs greatly with each other. The first type of product, is classified in three categories. The second type of product, is classified in three categories. But the third and the fourth one, is not classified in anything. Each product can have any number of different properties. I have a huge database,which containing about 500000 product in product table. So when I am going to fetch a product from database with all its attributes, or going to search product filtering by attributes, it makes effect on performance badly. Could any one can help me what will be the tables structure in sql or do some more indexing or any feasible solution for this problem. Because different ecommerce sites are using this kind of database and working fine with huge different types of products.

            L Offline
            L Offline
            Lost User
            wrote on last edited by
            #5

            Consider a parent table which contains all of the fields that are common to every product. (Ex: ProductID and Description, etc) then create a child table which contains all of the varying attributes which make up the product. The structure would be something like (ProductID, AttributeName, AttributeValue) how to franchise your business

            1 Reply Last reply
            0
            Reply
            • Reply as topic
            Log in to reply
            • Oldest to Newest
            • Newest to Oldest
            • Most Votes


            • Login

            • Don't have an account? Register

            • Login or register to search.
            • First post
              Last post
            0
            • Categories
            • Recent
            • Tags
            • Popular
            • World
            • Users
            • Groups