SQL design approach for searching a table with an unlimited number of bit fields

前端 未结 5 2167
失恋的感觉
失恋的感觉 2020-12-31 23:01

Consider searching a table that contains Apartment Rental Information: A client using the interface selects a number of criteria that are represented as bit fields in the D

5条回答
  •  鱼传尺愫
    2020-12-31 23:33

    I suggest you go with the second approach, known as Entity-attribute-value model. It's probably the only approach that will scale as you need.

    You could also have two searches, the basic and the advanced. You keep the attributes for the basic search in one table, and all the advanced attributes in the other table. This way at least the basic search will remain rapid as the number of attributes will grow with time.

提交回复
热议问题