0

In my mysql table there are following values:

ID (unique)(Auto incre.)
INI
URL
Name
DeprSize
Dept. Location
Knownsince
MeetingNotes

The php queries are

1) SELECT * FROM `dep1` WHERE `INI`
2) SELECT * FROM `dep1` ORDER BY `dep1` .`Name` DESC


And the sql indexes are:
----------------------------------------------------------------------------
Keyname Type Cardinality Field
----------------------------------------------------------------------------
PRIMARY PRIMARY 13 FileINI
id UNIQUE 13 FileINI
Name UNIQUE 13 Name
FileINI_2 INDEX None FileINI

----------------------------------------------------------------------------

I have about 45 tables just like this one and about 1200 rows in them


Now here is the problem:

The data in MySQL runtime information are really bad (They are all in red so i assume that's not a good thing)
--------------------------------------------------------------------------------

Handler_read_rnd 15 M
Handler_read_rnd_next 202 M
Created_tmp_disk_tables 38
Select_full_join 48
Opened_tables 1 k
Table_locks_waited 151
--------------------------------------------------------------------------------


Can someone please help me on how i can optimize the queries so that the valuies like Handler_read_rnd_next are not too high all the time.

Thank you!

2
Contributors
1
Reply
2
Views
8 Years
Discussion Span
Last Post by pritaeas
0

Why do you have 3 indexes on the INI field (primary, unique and index) ?

Also add an index on (dep1 and name)

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.