Hello, please tell me as fast as possible to pull from the database record? I wrote this code
select `id`,`title` from `class_ads` where `active`='1' ORDER BY RAND() limit 1
but this query takes more than half a second, because the records in the database is a lot like to speed this up? the option of obtaining the total number of entries and receipt between it and 1 is any number , and then stand for this number in the where clause isn't working for me..