I have a table and it's structured the following way:
CREATE TABLE `table` (
`type` int(11) NOT NULL,
`value` int(11) NOT NULL,
+ Some additional fields
KEY `type` (`type`)
)
What's the most efficient way to write the following query: Select the item with the maximal value of some certain type, let's say 'type0'.
If it's possible, could you also explain, what happens beneath the query (I mean, something that can affect the resulting algorithmic complexity).