Hi,

Yes that would be a better solution than to keep inserting a new
record.
However, you'll have to be careful with the concurrent update of the
2nd field ie if 2 process tries to update the same field at the same
time etc.
So locking table before update would help.

> I have a table that has 2 fields. 1 is an auto-incrementing
> field the other
> is a profile id that is joined to some other tables to
> track how often a
> record was accessed. The way we are doing it is that each
> time a record is
> accessed we also update this table with the profile id and it
> auto-increments a new record. this is working for us now,
> but I am worried
> about scale-ability. Right now to find out how many times a
> record was
> accessed we just count how many times that id is in the
> table. After a month
> and a half 95,000 records.
>
>       This has been causing the database to crash and hang,
> taking up 98%
> resourses... you get the idea. So is it possible to have
> two fields with the
> profile_id be the primary key and the second be updated by
> the database with
> a +1
>
>
> ------------------------------------------------------------
> ---------
> Before posting, please check:
>    http://www.mysql.com/manual.php   (the manual)
>    http://lists.mysql.com/           (the list archive)
>
> To request this thread, e-mail <[EMAIL PROTECTED]>
> To unsubscribe, e-mail
> <[EMAIL PROTECTED]>
> Trouble unsubscribing? Try:
http://lists.mysql.com/php/unsubscribe.php


---------------------------------------------------------------------
Before posting, please check:
   http://www.mysql.com/manual.php   (the manual)
   http://lists.mysql.com/           (the list archive)

To request this thread, e-mail <[EMAIL PROTECTED]>
To unsubscribe, e-mail <[EMAIL PROTECTED]>
Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php

Reply via email to