i am using to fetch record from database and records are likely be '590096' and query table time around 4 sec and i want to make it more faster which is like
less then 1 sec can you please guide me how should i do this i am using normal select query
SELECT count(*) from table where field6 > '$s'
i am also using date like below given code for condition
$t15m_ago = new DateTime("15 minutes ago");
$s = $t15m_ago->format("Y-m-d H:i:s");
would it be due to this?
Below is my database
CREATE TABLE table (
field0 int NOT NULL auto_increment,
field1 varchar(20),
field2 int,
field3 int,
field4 varchar(255),
field5 varchar(60),
field6 DATETIME,
PRIMARY KEY(field0)
)
What exactly i want to do with select query i count records from table will last 15 mins. my table is inserting thousands of records in every sec.