List:General Discussion« Previous MessageNext Message »
From:Johnny Withers Date:January 11 2010 3:56pm
Subject:Re: tmp tables
View as plain text  
Victor,

The temporary table solution is not a good one. Use a single table and store
each item put into a cart identified by the session ID of the user. A
process should clean out this table periodically since there are "shoppers"
that abandon carts from time to time.

The design of this table could be quite simple:

id - int auto_inc
session_id - varchar
added_dt - datetime
item_id - int
quantity - int

You could get more complicated depending in your need an item requirements
(colors, sizes, etc).

-JW


On Mon, Jan 11, 2010 at 9:30 AM, Victor Subervi <victorsubervi@stripped>wrote:

> On Mon, Jan 11, 2010 at 10:49 AM, Baron Schwartz <baron@stripped> wrote:
>
> > Victor,
> >
> > > That strikes me as messy. Each tmp table has as many rows as necessary
> > for
> > > the products that are to be bough. To do as you say I would have to
> > create a
> > > table with a zillion rows to accommodate however many products I
> > *predict*
> > > buyers would buy. Therefore, I guess I should probably create a new
> > database
> > > so as to not make a mess of the main database.
> >
> > You fundamentally misunderstand relational database design.  I suggest
> > reading this book:
> >
> >
>
> http://www.xaprb.com/blog/2009/08/22/a-review-of-beginning-database-design-by-clare-churcher/
> >
>
> LOL. Ok, I'll put it on my list. *In the meantime*, since I am reworking my
> database design for the shopping cart I just finished building and need to
> get this up __n_o_w__, what would your advice be?
> V
>
> >
> > Regards,
> > Baron
> >
> > --
> > Baron Schwartz
> > Percona Inc: Services and Support for MySQL
> > http://www.percona.com/
> >
>
>
>
> --
> The Logos has come to bear
> http://logos.13gems.com/
>



-- 
-----------------------------
Johnny Withers
601.209.4985
johnny@stripped

Thread
tmp tablesVictor Subervi10 Jan
  • Re: tmp tablesBaron Schwartz11 Jan
    • Re: tmp tablesVictor Subervi11 Jan
      • Re: tmp tablesBaron Schwartz11 Jan
        • Re: tmp tablesVictor Subervi11 Jan
          • Re: tmp tablesKeith Murphy11 Jan
            • Re: tmp tablesVictor Subervi11 Jan
          • Re: tmp tablesJohnny Withers11 Jan
            • Re: tmp tablesmos12 Jan
              • Re: tmp tablesVictor Subervi13 Jan
                • Re: tmp tablesJohnny Withers13 Jan
                  • Re: tmp tablesVictor Subervi13 Jan
                    • Re: tmp tablesChris W14 Jan
                      • Re: tmp tablesVictor Subervi15 Jan