The table arg_rec contains 800K rows on my test machine, normally this table will hold over 15M rows. I want to run the following query :
SELECT STE_ID, PNT_NO,
For best performance in GROUP BY queries you must add covering index as:
ALTER TABLE arg_rec ADD KEY ix1(STE_ID, PNT_NO, YR, MN,AVR_WS, AVR_PW );
For covering index you add:
Visit for details: Group By Optmization in MySQL
You can cache queries in MySQL by enabling query cache loot at Query Cache Configuration
You can store YR, MN, DY, HR, MI, SC in a single column having data type as TIMESTAMP
which will increase performance of indexing and group by operation.