in reply to Key to use for files in db!
With hashkey indexed.SELECT FROM mytable WHERE hashkey = '4ea' && path = '/my/path/to/file/ +isthis.dat';
EDIT: I should also note here that variable-width fields can't be indexed in their entirety. You have to define a width for your key, which means either leaving out part of some variable-width fields or padding most of them (which defeats the whole purpose of a variable-width field). It's much better to use a CHAR(3) key (see above).use Digest::MD5 qw(md5 md5_hex md5_base64); my $path = '/my/path/to/file/isthis.dat'; my $hashkey = substr(md5_hex($path), 0, 3);
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: Key to use for files in db!
by Ace128 (Hermit) on Dec 30, 2005 at 14:48 UTC | |
|
Re^2: Key to use for files in db!
by pajout (Curate) on Jan 02, 2006 at 13:05 UTC | |
by Ace128 (Hermit) on Jan 05, 2006 at 22:53 UTC | |
by pajout (Curate) on Jan 06, 2006 at 11:12 UTC | |
by Ace128 (Hermit) on Jan 17, 2006 at 19:17 UTC | |
by pajout (Curate) on Jan 18, 2006 at 18:23 UTC |