Jump to content

gassaz

Members
  • Posts

    61
  • Joined

  • Last visited

    Never

Everything posted by gassaz

  1. I think the only way to get the magic number is increasing the values until get the best performance. For example I started at 32M, now i have a performance that work for my needs.
  2. You can try adding the line query_cache_size=x x = this value will depends of the amount of system memory, on my production server i set it up to 64M. If you tables are InnoDb like, you can try adding this too: innodb_buffer_pool_size=y y= this value will depends of the amount of system memory, this don't need to be like query_cache_size even it could be more or less. I hope this can help you.
  3. Try this.. DELIMITER $$ USE `db`$$ DROP TRIGGER /*!50032 IF EXISTS */ `tai_1`$$ CREATE TRIGGER `ta1_1` AFTER INSERT ON `tablename` FOR EACH ROW BEGIN SET @resultset = (SELECT SUM( Unit_For ) / SUM( Unit_Against ) FROM Unit_tbl WHERE Pred_ID = NEW.Pred_ID); UPDATE Pred_tbl SET Val_Against = @resultset WHERE Pred_ID = NEW.Pred_ID; END; $$ DELIMITER ;
  4. Maybe if you store the select into a variable and use the variable to the update query.. Something like this.. SET @resultset = (SELECT SUM( Unit_For ) / SUM( Unit_Against ) FROM Unit_tbl WHERE Pred_ID = NEW.Pred_ID); UPDATE Pred_tbl SET Val_Against = @resultset WHERE Pred_ID = NEW.Pred_ID;
  5. Try running the update + select without the trigger..
  6. i think you will have to code to get the result that you want. if you want each article you don't need a count() SELECT YEAR(Date) as year, MONTHNAME(Date) as month, ID as articles FROM news
  7. Maybe if you can reestructure the query like this.. SELECT AVG(sum_column1) FROM (SELECT SUM(column1) AS sum_column1 FROM t1 GROUP BY column1) AS t1; i hope this will help you..
  8. Not, i mean ... Make a query for all the products that changed price value on 2009-02-01. For me too it's better a large table, the performance of the query will depends of the DB structure (indexes) if you like make a lot of tables do it.. your querys will fly.. but the time to make the querys it will be a long time.. Good look..
  9. well that is your table... Now, what things do you want to make a history?
  10. First.. make a list of things that you want to store.. example: object name object description price date of buy try to make the list and post it...
  11. how do you think store the data?? please show the db design that you have made until now....
  12. From asp.net to connect to mysql you need the driver... (Mysql.data.dll) you can download it from the mysql page. When you get the driver, you can add a reference to the driver into your asp.net project. Now you can use something like this.. Dim conn As New MySqlConnection(ConnectionString) Dim myCommand As New MySqlCommand Dim myAdapter As New MySqlDataAdapter Dim myData As New DataTable myCommand.Connection = conn Try myCommand.CommandText = sql myAdapter.SelectCommand = myCommand myAdapter.Fill(myData) 'here add your code Catch myError As MySqlException MsgBox(myError.Number & " " & myError.Message) Finally conn.Close() End Try
  13. Well, it depends.. depends of what??, a little example: Somebody wants a report for a list of products that changed his value on 2009-02-01. If you use 7000 tables, how you will do that query??
  14. Something like this?? Select club, sum(points) from DBName group by club order by sum(points) DESC LIMIT 0,3;
  15. Why a table for product??? Which option will take less time?? I prefer to make one table... why?? well.. first time!!! and second database normalization.
  16. Something like this?? SELECT `users`.`user_character` , SUM(`ach`.`points`) AS total_points FROM `user_ach` INNER JOIN `ach` ON (`user_ach`.`ach_id` = `ach`.`id`) INNER JOIN `users` ON (`users`.`user_id` = `user_ach`.`user_id`) GROUP BY `users`.`user_character` ORDER BY `users`.`user_character` ASC, SUM(`ach`.`points`) DESC LIMIT 0,10;
  17. TEXT is a reserved word, if you can change it do it or use `text`
  18. Try this: CREATE TABLE new_table SELECT company_list.company_name FROM company_list; When the new table is created you can add the rest of the columna
  19. The best optios for me is store de genres in a design like this.. [attachment deleted by admin]
  20. Check this... http://dev.mysql.com/tech-resources/articles/mysql-storedprocedures.pdf
  21. Try this: select ID from s_copy order by SUBSTRING(ID from 2) + 0
  22. For me you are right it's becase Apostrophes .. In vb i used this to correct that problem Replace(TXT_PRI.Text, "'", "\'") I don't know commands of string manipulation en php sorry...
  23. A crazy idea: stop the service Delete or move the log files start the service When you start the service MySql will try to make a new log file.. I used this when i got corrupted the ib_logfile0...
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.