in reply to Re: combining cookies and user registration - strategies?
in thread combining cookies and user registration - strategies?
vs.
Users (boolean flag)
id, anon, data
In the first example, to retrieve a given username, your perl code has to retrieve EVERY row, split the id field on "-" and check for a match.
In the other example you simply ask the database for the row(s) "where id = $userid and anon = false". The database will be much faster because it can use indexes to skip a great deal of the records and quickly zero in on the user id of your choice. Remeber, a good database (ala Postgres) will be written in C and is optimized for grinding through large amounts of data efficiently.
|
|---|