RE: text records and cross referencing

2009-08-20 Thread Pol
posted mailed Gavin Towey wrote: Hi Pol, MySQL support FULLTEXT indexes, and natural language searches, including Boolean conditions. This may help you; however, you will have to adjust the default behavior of the index, but changing server settings. By default there is a minimum word

Simple join very slow

2009-08-20 Thread Simon Kimber
Hi Everyone, Can anyone suggest why the following query is taking upwards of 5 seconds to run? SELECT * FROM users JOIN sites ON users.ID = sites.userid WHERE users.username = 'user1234' OR users.email = 't...@test.com' OR sites.email = 't...@test.com' mailto:'ccf...@googlemail.com' The

alternate in mysql

2009-08-20 Thread Ananda Kumar
Hi All, I have this data in both oracle and mysql. select * from tmp; T -- asdf /sr/db/ora/ora.ora asdfljk asdlkjf asdf /sr/db/ora/ora.ora /sr/db/ora/aaa.ora asdlkjf Where t is a varchar column, with each row having multiple lines. I can write this

Re: Simple join very slow

2009-08-20 Thread Johnny Withers
MySQL can only use one index at a time. Your OR's makes it unable to use any of the indexes. You could try a UNION: SELECT * FROM users WHERE users.username='user1234' UNION SELECT * FROM users INNER JOIN sites ON users.id=sites.userid WHERE users.email='t...@test.com' UNION SELECT * FROM users

Re: alternate in mysql

2009-08-20 Thread Johnny Withers
You could try: SELECT * FROM tmp WHERE t REGEXP '^/sr/db/.*'; On Thu, Aug 20, 2009 at 9:15 AM, Ananda Kumar anan...@gmail.com wrote: Hi All, I have this data in both oracle and mysql. select * from tmp; T -- asdf /sr/db/ora/ora.ora

Re: Simple join very slow

2009-08-20 Thread Perrin Harkins
On Thu, Aug 20, 2009 at 10:43 AM, Johnny Withersjoh...@pixelated.net wrote: MySQL can only use one index at a time. That was fixed years ago, in MySQL 5.0. http://dev.mysql.com/doc/refman/5.0/en/index-merge-optimization.html - Perrin -- MySQL General Mailing List For list archives:

Re: Simple join very slow

2009-08-20 Thread mos
You didn't say what version of MySQL you're using or if you're using MyISAM tables (assumed). Since you are using OR's you may find it faster to use Union on 3 select statements. It looks something like this: SELECT * FROM users JOIN sites ON users.ID = sites.userid WHERE users.username =

Re: foreign keys: Cannot create InnoDB table

2009-08-20 Thread wabiko.takuma
Hi, Martijn, Gavin. SHOW INNODB STATUS gave me helpful messages like following: LATEST FOREIGN KEY ERROR 090821 12:53:18 Error in foreign key constraint of table test_fk/tbl1: FOREIGN KEY (`col1` , `col2` , `col3` ) REFERENCES