-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Thomas, et al --

...and then Thomas Spahni said...
% 
% On Mon, 20 Jan 2003, David T-G wrote:
% 
...
% >   create table pieces
% >   (
% >     # ID number
% >     id smallint unsigned not null default 0 auto_increment primary key ,
% >     title char(50) ,
% >     index (title) ,
% >     words text (4095) ,
% >     fulltext index (words(4095))
% >   ) ;
% 
% David,
% 
% try the following:
% 
% create table pieces (
%   id smallint unsigned not null auto_increment primary key,
%   title varchar(50),
%   words text,
%   key (title(16)),

It took me a minute to figure out this one...  Only well down in the
'create table syntax' section does it state that "key is a synonym for
index" :-)


%   fulltext (words)
% ) TYPE=MYISAM;
% 
% Are you sure that smallint is enough for your index? Do you really need to

I've thought about that a bit, but don't know if there is a more 'right'
answer that comes with experience...  In this case and other cases I've
had so far, it is; that will give me 64k.  Perhaps it's not worth thinking
about the few bytes a smallint will save me; I already use smallint even
where tinyint will do just fine for the sake of consistency ("all of my
ID columns are smallint, so foreign key references can automatically be
smallint").  Do you suggest that perhaps I just go with int or bigint for
my IDs, again for consistency but now across all of my work rather than
just guaranteed within a database?


% index the full title?

I think so...  If the title is "Let Not the Wise Man Glory in his Wisdom"
and I want to be able to use 'wisdom' as a keyword for my search, it
needs to be indexed, right?


% 
% Thomas Spahni
% -- 
% filter: mysql, query


Thanks & HAND

mysql query,,
:-D
- -- 
David T-G                      * There is too much animal courage in 
(play) [EMAIL PROTECTED] * society and not sufficient moral courage.
(work) [EMAIL PROTECTED]  -- Mary Baker Eddy, "Science and Health"
http://justpickone.org/davidtg/      Shpx gur Pbzzhavpngvbaf Qrprapl Npg!

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.0.7 (FreeBSD)

iD8DBQE+LTunGb7uCXufRwARAqpIAJ95Fhu5f+HH3tcicF+yUku0pfvjawCbBx1P
uM4AIpHzJnuT8T7ZU/mhP+8=
=dZi/
-----END PGP SIGNATURE-----

---------------------------------------------------------------------
Before posting, please check:
   http://www.mysql.com/manual.php   (the manual)
   http://lists.mysql.com/           (the list archive)

To request this thread, e-mail <[EMAIL PROTECTED]>
To unsubscribe, e-mail <[EMAIL PROTECTED]>
Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php

Reply via email to