|
Posted by Mike Hummel on 04/19/05 17:32
just do a select limit 11
display up to 11... if less then 11, you might want to display them anyways.
you should be able to deal with up to a million + records, so select
will stay quick, esp if you make the right fields indexed.
you can take care of purging via crons...
you might find you want the history in the end...
-m
Ryan A wrote:
> Hey!
> I think I solved this:
>
> select 11 latest visitors
> count to see if it returned 11 records,
>
> if (count == 11){
> get the oldest (of the 11) visitors time
> delete everything from that record and older than that
> }
> else{}
>
> Pros: max 2 queries
>
> If i am missing anything or you see any problem in my logic, please point it
> out.
>
> Thanks,
> Ryan
>
>
>
Navigation:
[Reply to this message]
|