
Originally Posted by
zeeshanhashmi
The data in the 28 fields (Varchar size 1) are like "1" and "0"
this is a big problem, but easily solved
since you did not share the table design with us, i'm gonna make up an example
let's pretend that these columns are called something like this -- likes_dogs, likes_kids, owns_car, owns_jet, previously_married, ...
remove these columns from your table
(indexing them wouldn't help your query performance anyway, because of high cardinalities)
create a new table as follows:
Code:
CREATE TABLE properties
( main_id INTEGER NOT NULL
, property VARCHAR(99)
, PRIMARY KEY ( main_id, property )
, yes_or_no TINYINT
);
get the idea?
Bookmarks