Database entries existence depends on time / boolean value of a field changed automatically

Posted by lisak on Stack Overflow See other posts from Stack Overflow or by lisak
Published on 2011-01-12T01:49:41Z Indexed on 2011/01/12 1:53 UTC
Read the original article Hit count: 463

Filed under:


I have this situation here.

  • An auction system listing orders that are "active" (their deadline didn't occur yet)
  • There is a lot of orders so it is better to have a field "active" instead of listing them based on time queries

I'm not a database expert, just a user. What is the best way to implement this scenario ?

  • Do I have to manually check the "deadLine" field and change "active" status every once in a while ?
  • Is Mysql able to change the field automatically ?
  • How demanding are queries of type "select orders where "deadline" has passed "
  • Do I need to use TIMESTAMP (long data type of number of milisecond since UTC epoch time or DATETIME for the queries to the database to be more efficient ?

Finally I have to move old order entries to a different backup table .

© Stack Overflow or respective owner

Related posts about mysql

Related posts about database