I've recently moved to a dedicated Windows hosting with Plex CPanel through godaddy. I've setup my site and database (MySQL)
I am now recently noticing my database queries are now taking a lot longer than expected.
My tables:
Here is an example:
SELECT a.snapshot_id, a.brand_id, b.brand_id
FROM snapshots a
INNER JOIN brands b
ON a.brand_id = b.brand_id
WHERE DATE(a.date_sent) = '2014/11/10'
using PhpMyAdmin, running this query:
Showing rows 0 - 247 (248 total, Query took 30.1080 seconds.)
that is a long time when this is executed on the site's homepage.
Any suggestions on how I can optimize this? Or is the server really slow?
The snapshots table has over 45K rows.
The EXPLAIN output:
Crazy find! When comparing the ROWS and SIZE between shared hosting and dedicated hosting of the same database and table.
Shared: 1,023,459 records @ 1.8GiB Dedicated: 43,916 records @ 4.5GiB
Why is there a discrepancy?