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

Thomas, et al --

...and then Thomas Spahni said...
% 
% Hi, David

Hi!


% 
% On Tue, 21 Jan 2003, David T-G wrote:
% 
% > % 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'
...
% > 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?
% 
% I would suggest to use INT UNSIGNED. Primary keys are not re-used and with
% SMALLINT you could easily run out of numbers.

Fair enough.  Damn the disk space; we'll use four bytes instead of two :-)


% 
% > % 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?
% 
%  ... that would be a query similar to:
% 
%   SELECT * FROM mydb WHERE musictitle LIKE '%wisdom%';

Hmmm...  That makes sense.


% 
% and this will not use the index at all. You have to set up a FULLTEXT
% index on your titles or search  LIKE 'let not%'.

And, in fact, I could use '%wise%glory%', right?  But what about
searching for keywords 'wisdom' and 'glory'?  If I list them in that
order, no matter how I use %, I won't get the result.  Should I use some
ANDs in there?  Would I want to do that with a fulltext anyway, and the
fulltext just speeds things up?


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


TIA & 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+L9meGb7uCXufRwARAqN8AKDe0QOO48quMrTWXyeup2aqH0ZCOQCgwnkI
h0SurqJODmKtX72w7+1rBL8=
=Ctof
-----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