Re: [PHP-DB] Design conundrum...

2001-06-23 Thread Antonio Mármol Albert

El sábado 23 de junio de 2001  (13:52), Kristian Duske escribió:

  The problem involves 2 tables, one of editors and one of categories, both
  have unique ID numbers.  Each editor can have authority over an arbitrary
  number of categories, and conversely, each category can have an arbitrary
  number of editors.  So what is the best way to represent this in the DB?
  (Which is PostgreSQL 7 BTW)
 
 This is a so-called N:N relation, and this usually calls for a third table
 to store the cross-relations:
 
 table editors
 id, name, email
 
 table categories
 id, name
 
 table ediors_categories
 editor (id of editor)
 category (id of category)

With index in the third table, How would it be ?

PRIMARY KEY (editor, category)

 or

KEY (editor),
KEY (category)

What's the better (more efficient and correct) ??

Regards
-- 
Antonio Mármol Albert ( [EMAIL PROTECTED] )
http://www.infurma.es

-- 
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




[PHP-DB] Search in a MySQL TEXT field

2001-06-20 Thread Antonio Mármol Albert

Hello,

What is the better method for doing searchs in a TEXT field ?

I have news in a web, but I think that use  field LIKE '%foo%'  can
overload my server if the traffic grows up.

Have you any reference about this? (urls, scripts, methods, documents...)

Thanks
-- 
Antonio Mármol Albert ( [EMAIL PROTECTED] )
http://www.infurma.es

-- 
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]