I have a table:
URL | last_crawled | worker_id | worker_assign_date
The url is obviously any url. The last_crawled is a date field that stores when the field was last crawled. Worker ID is a id for a worker that is currently assigned to this URL. And the worker_assign_date is when the URL was assigned to a crawler. This is so that if worker X takes too long to crawl a URL, I will just assign the URL back to another worker.
My question is, seeing as I will be sorting by worker_assign_date a lot and last_crawled a lot, what should that type be?
First priority is speed, which sorts faster? Int or DateTime?
Second priority is size. Does an int take up less space than DateTime or more?
Please note: The internet has roughly 5 billion pages. This database is to hold all 5 million URLs and make updates etc. I will use InnoDB so I can lock single rows only.
UPDATE
A unix timestamp, that will "work" until 2099, would be 4099770061, so storing it as INT(10) would be more than sufficient. According to the mysql documentation, that would take up 4 bytes. A datetime field will take up 8 bytes. So, it seems that timestamps are at least smaller. Is that true?
Also, the last question then remains, which is faster during a sort? Is there any difference?