Example
There is an application that measures temperature in each town of the world. Each measurement is taken every 5 minutes and written in to the Measurement table.
CREATE TABLE [dbo].[Measurement](
[MeasurementID] [int] IDENTITY(1,1) NOT NULL,
[Town] [varchar](50) NOT NULL,
[Date] [datetime] NOT NULL,
[Temp] [int] NOT NULL,
CONSTRAINT [PK_Measurement] PRIMARY KEY CLUSTERED
(
[MeasurementID] ASC
)) ON [PRIMARY]
Question
What is the most efficient query to get a list of the towns and their current temperature?
Assume there are 100k towns and 10 million records
NOTE: I have added a couple of possible answers, but there are probably other options.