Hi Johnny,
Thanks for the reply, but the below sql does not seems to work
SELECT * FROM tmp WHERE t REGEXP '^/sr/db/.*';
Empty set (0.02 sec)
mysql> SELECT * FROM tmp WHERE t REGEXP '/sr/db/.*';
++
| t
Hi All ,
Am working on the autosuggestion program
SELECT $field2,$field1 FROM $tblname where locate('$q', $field2) > 0 OR
locate('$q', $field1) > 0 order by locate('$q', $field2),
$field2 limit " . ($pagesize * $page) . "," . $pagesize
This is my query ,
Example in my Database tab
Hi list,
I have two tables send_sms and alt_send_sms. Users are inserting records
into send_sms @ 500/sec ie 3/min. After applying some updates to
send_sms data are transferred to alt_send_sms and deleted from send sms. The
same thing is happening with alt_send_sms table.
Is it possible to in
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 `
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 = 'use
On Thu, Aug 20, 2009 at 10:43 AM, Johnny Withers 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: http://lists.mysql.com/mysql
T
You could try:
SELECT * FROM tmp WHERE t REGEXP '^/sr/db/.*';
On Thu, Aug 20, 2009 at 9:15 AM, Ananda Kumar wrote:
> Hi All,
> I have this data in both oracle and mysql.
>
> select * from tmp;
> T
> --
> asdf
> /sr/db/ora/ora.ora
> asdfljk
> asdlk
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
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
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'
The users table has an index on the us
10 matches
Mail list logo