Re: Are redundant fields ever appropriate?
Date: Wed, 7 Nov 2001 21:37:30 -0500
Message-ID: <9scr52$nkm$1_at_bob.news.rcn.net>
Eel wrote:
> Hi,
> I know this is a pretty basic question, but I
> can't seem to find an answer anywhere. If I have
> a few tables like:
>
> InvoiceHeader:
> Invoice#
> Customer#
> Job#
> Date
>
> InvoiceLines:
> Invoice#
> Part#
> Quantity
> Price
>
> Say I wanted to make sorted lookups faster and wasn't much
> worried about update speed. Would it ever be appropriate
> to have a table like:
>
> InvoiceLines:
> Invoice#
> Part#
> Quantity
> Price
> Customer#
>
> The reason I'd want to do it would be to make reporting
> for line items by customer# faster. Is this something
> I'd ever want to do? Am I asking for trouble if I do
> it?
>
> Thanks!
>
If the only reason you are doing this is for performance I suggest that you run some timed tests before you get too far into development. Depending on the number of customers and the number of invoices you have you may not save any time. This is because most (perhaps all) modern DBMS treat RAM as a Least Recently Used cache.
In short if you are using decent equipment and a decent DBMS you probably won't save enough time (if any) to make it worthwhile.
-- Jerry Gitomer Once I learned how to spell DBA, I became oneReceived on Thu Nov 08 2001 - 03:37:30 CET