Hi,
I am currently having more than 1000 data rows in one of my tables, and when I tried to run a data retrieval for all my data, the process is terribly slow.
I only have the primary key as an index, and the data retrieval will retrieve data from 2 to 3 other tables, together with the table that contains 1000 rows.
Is there any way that I will be able to optimize the database to make it run faster?
Thank you very much.
Mysql Optimization
Started by missionaire, Feb 07 2007 03:07 AM
3 replies to this topic
#1
Posted 07 February 2007 - 03:07 AM
#2
Posted 07 February 2007 - 12:47 PM
Well, as far as I know, all you can do is optimize the table with indexes for columns you would frequently use for indexing your search, and use those indexes in your WHERE or ORDER BY clauses.
The second half is optimizing your actual query, using more clauses such as WHERE, ORDER BY, and LIMIT.
The second half is optimizing your actual query, using more clauses such as WHERE, ORDER BY, and LIMIT.
#3
Posted 07 February 2007 - 11:35 PM
OPTIMIZE TABLE `table_name`
or
OPTIMIZE TABLE `table_name`, `table_name_2`for multiple tables.
you can put it in a PHP script to run in a cron job automatically once a day.
#4
Posted 08 February 2007 - 01:50 AM
Demonslay, on Feb 7 2007, 12:47 PM, said:
Well, as far as I know, all you can do is optimize the table with indexes for columns you would frequently use for indexing your search, and use those indexes in your WHERE or ORDER BY clauses.
The second half is optimizing your actual query, using more clauses such as WHERE, ORDER BY, and LIMIT.
The second half is optimizing your actual query, using more clauses such as WHERE, ORDER BY, and LIMIT.
Good luck!
1 user(s) are reading this topic
0 members, 1 guests, 0 anonymous users
