Re: distinct count operation with the use of where count $num

2012-06-17 Thread Tsubasa Tanaka
Hi, you have to use `HAVING' instead of `WHERE' like this. SELECT DISTINCT `term`, COUNT(*) AS count FROM blp_sql_distinct_temp_table GROUP BY `term` HAVING count = 5 ORDER BY count DESC; put `HAVING' next of `GROUP BY'. `WHERE' behaves at before aggregate of `GROUP BY'. your SQL means like

Re: Which Database when lot of insert / update queries to execute

2012-06-15 Thread Tsubasa Tanaka
Hello, I am designing a solution which will need me to import from CSV, i am using my JAVA code to parse. CSV file has 500K rows, and i need to do it thrice an hour, for 10 hours  a day. try to use `LOAD DATA INFILE' to import from CSV file.

Re: category with parentid

2012-05-30 Thread Tsubasa Tanaka
Pesebe-san, I'm sorry to i'm not clear what do you want to do. do you mean like this? (exampled by Perl) #--- use DBI; $cn = DBI-connect(DBI:mysql:test,root,); $st = $cn-prepare(SELECT t1.name AS cat,GROUP_CONCAT(t2.name) AS subcat FROM `table` AS t1 LEFT JOIN `table` AS t2 ON t1.id =

Re: category with parentid

2012-05-28 Thread Tsubasa Tanaka
Hello Pesebe-san, how about this? SELECT t1.name AS cat, GROUP_CONCAT(t2.name) AS subcat FROM table AS t1 LEFT JOIN table AS t2 ON t1.id = t2.parentid WHERE t1.parentid = 0 GROUP BY cat; +---+---+ | cat | subcat| +---+---+ | cat A |

Re: Need help for performance tuning with Mysql

2012-05-22 Thread Tsubasa Tanaka
Hello, I seem your mysqld doesn't use enough memory. Date Time CPU% RSS VSZ 2012/5/22 21:00:39 109 294752 540028 if your mysqld uses InnoDB oftenly, edit innodb_buffer_pool_size in you my.cnf.

Re: Need help for performance tuning with Mysql

2012-05-22 Thread Tsubasa Tanaka
, on MyISAM. I will consider the tuning of innodb_buffer_pool_size as well. Do you know the tips for how to tune the disk access for MyISAM? Thanks, Yu Tsubasa Tanaka さんは書きました: Hello, I seem your mysqld doesn't use enough memory. Date Time CPU% RSS VSZ 2012/5/22 21:00:39 109