An index would be pretty typical even for many million rows.

Have you tried it, and is it a bottleneck? If not, don't prematurely
optimise.

http://c2.com/cgi/wiki?PrematureOptimization

David Neilsen | 07 834 3366 | PANmedia ®


On Thu, Aug 8, 2013 at 4:03 PM, ashley etchell <[email protected]> wrote:

> Would using INSERT DELAYED help with the write process?
>
> You could consider storing viewed posts per user in a serialized or csv
> text file or look at usi g merge tables somehow.
>
> Regards
> Ash
> On 8 Aug 2013 15:56, "matt thomson" <[email protected]> wrote:
>
>> Hi everybody,
>>
>> I'm working on a forum like web app where I record what topics have been
>> read by a logged in user. Usually for a many-to-many relation like this, I
>> would use a 3rd table, and have a user_id and a topic_id column in the
>> table. I'm not sure if this is scalable in this case though, the table will
>> meet three conditions:
>>
>> It will be written to on almost most page views (to say the current topic
>> has been read).
>> It will be read from on most page views (to check which topics have been
>> read and make this in the html).
>> It may get very large (eg 1 million+ records).
>>
>> Usually, if a table is going to be this big and queried a lot, I will put
>> an index on the columns that are queried. However, as well as being read
>> from frequently, the table is also being written to frequently. As indexes
>> take time to update on write, then updating the index constantly might end
>> up slowing the table down so much that this method is not scalable.
>>
>> Does anyone know a way around this issue?
>>
>> Thanks.
>>
>> --
>> --
>> NZ PHP Users Group: http://groups.google.com/group/nzphpug
>> To post, send email to [email protected]
>> To unsubscribe, send email to
>> [email protected]
>> ---
>> You received this message because you are subscribed to the Google Groups
>> "NZ PHP Users Group" group.
>> To unsubscribe from this group and stop receiving emails from it, send an
>> email to [email protected].
>> For more options, visit https://groups.google.com/groups/opt_out.
>>
>>
>>
>  --
> --
> NZ PHP Users Group: http://groups.google.com/group/nzphpug
> To post, send email to [email protected]
> To unsubscribe, send email to
> [email protected]
> ---
> You received this message because you are subscribed to the Google Groups
> "NZ PHP Users Group" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to [email protected].
> For more options, visit https://groups.google.com/groups/opt_out.
>

-- 
-- 
NZ PHP Users Group: http://groups.google.com/group/nzphpug
To post, send email to [email protected]
To unsubscribe, send email to
[email protected]
--- 
You received this message because you are subscribed to the Google Groups "NZ 
PHP Users Group" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
For more options, visit https://groups.google.com/groups/opt_out.


Reply via email to