DATE, DATETIME, TIMESTAMP should all be the same:
Code:
SELECT * FROM table WHERE datefield >= DATE_SUB( CURDATE(), INTERVAL 31 DAY )
If you use a UNIX timestamp (that is, an INT to hold a UNIX/Linux timestamp value) then you have to convert it:
Code:
SELECT * FROM table WHERE FROM_UNIXTIME(intfield) >= DATE_SUB( CURDATE(), INTERVAL 31 DAY )
though realistically you *can* use the INT and get the same performance by just inverting that:
Code:
SELECT * FROM table WHERE intfield >= UNIX_TIMESTAMP( DATE_SUB( CURDATE(), INTERVAL 31 DAY ) )
See it? By converting the DATE_SUB result to a unix time, you only have to do that conversion *ONCE* when the query is built and so the time for the WHERE clause is just as fast as when using a DATETIME, et al.
There are other cases, though, where you really would have to use FROM_UNIXTIME() on each INT field value, and so then you do pay a penalty.