2 Replies - 733 Views - Last Post: 22 May 2011 - 12:47 PM Rate Topic: -----

#1 drayarms  Icon User is offline

  • D.I.C Head

Reputation: 4
  • View blog
  • Posts: 199
  • Joined: 18-May 11

Can multiple entries in a mysql table column cause server to crash?

Posted 22 May 2011 - 12:27 PM

Here is one of those purely conceptual questions, which involves no code. I'm trying to create a select query which among other things, allows a user of a website to search other members who fall within a particular age range. I have a column in the table where the members' information are stored which records their ages. Which brings us to the problem. On any given day, a member's age may increase by one year compared to what it was the previous day, hence the need to update this column periodically. I can't think of any way to automatically update this column on a daily basis. So my solution is to run an initial update query every time a member tries to search other members based on age, which updates the age column for all other members, before running the select query which eventually retrieves the desired age range. This leads to the second problem. Imagine there are thousands of users using the website. At any given instance, there could be hundreds of members, trying to search others based on age. This means hundreds of users will be updating a single column (the age column) in one table at the same time. Is this feasible? Can it cause the server to crash? Or is there really a more reasonable way to do all of this? Thank you all for taking your time to read this. Appreciate any responses.

Is This A Good Question/Topic? 0
  • +

Replies To: Can multiple entries in a mysql table column cause server to crash?

#2 openinfinity  Icon User is offline

  • D.I.C Head

Reputation: 3
  • View blog
  • Posts: 215
  • Joined: 25-March 09

Re: Can multiple entries in a mysql table column cause server to crash?

Posted 22 May 2011 - 12:47 PM

How about storing the birthdate instead of the age that way when checked against current date it would always be current

This post has been edited by openinfinity: 22 May 2011 - 12:49 PM

Was This Post Helpful? 1
  • +
  • -

#3 Dormilich  Icon User is offline

  • 痛覚残留
  • member icon

Reputation: 4128
  • View blog
  • Posts: 13,020
  • Joined: 08-June 10

Re: Can multiple entries in a mysql table column cause server to crash?

Posted 22 May 2011 - 12:47 PM

View Postdrayarms, on 22 May 2011 - 09:27 PM, said:

Or is there really a more reasonable way to do all of this?

donít use an `age` column, rather use a `birth_date` column and query against (the difference to) NOW() (NOW, CURRENT_DATE, etc.). database are able to run more or less complex calculations themselves.
Was This Post Helpful? 1
  • +
  • -

Page 1 of 1