[Pdx-pm] Shopping Cart Logic

Tkil tkil at scrye.com
Fri Mar 7 00:31:56 CST 2003


>>>>> "AJ" == A J Weinzettel <A.J.> writes:

AJ> What other ways can I keep the database nice and clean?

Assuming that you'll get a steady flow of customers, you could clean
up the list of active carts every time you create a new one.  Offhand,
I'd use a timestamp for each cookie, and keep an index on the time
stamp.  That should make it quite fast to find all timestamps older
than a certain time.  (Assuming that an index is necessary at all --
try it without one first, and see if it is fast enough.)

Since you're inserting a new value into the table at this time, you're
going to have to lock the table (or at least a part of it) anyway, so
cart+cookie creation time seems a good time to cull old cookies.

t.




More information about the Pdx-pm-list mailing list