in reply to OT - SQL choosing a schema for index tables
This seems like an ideal use for BIT() type fields; assuming none of your multi-value fields can have more than 64 possibilities.
Then in your program, you define constants for each of the bits in each of the fields:
use enum qw[ BITMASK:Usage_ cider juicer cooking eating display_and_th +row_away ]; use enum qw[ BITMASK:Flowers_ spring summer autumn winter ]; use enum qw[ BITMASK:Ripe_ spring summer autumn winter ]; use constant Any => -1; ... my $sth = prepare( 'select id from trees where usage = ? and flowers = + ? and ripe = ?;' ); $sth->execute( Usage_cider|Usage_juicer, Flowers_spring|Flowers_summer +, Any );
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: OT - SQL choosing a schema for index tables
by erix (Prior) on Aug 28, 2015 at 14:49 UTC | |
by BrowserUk (Patriarch) on Aug 28, 2015 at 15:18 UTC |