Reply to Re: SQL relationships and identities

Your name:

Reply:


Posted by Erland Sommarskog on 12/08/05 22:33

Alexander Kuznetsov (AK_TIREDOFSPAM@hotmail.COM) writes:
>>> But year_of_order or client_id should be in Orders only. There are cases
> where it's right to denormalise and duplicate data, but the better
> optimizers in modern RDBMS get, the less often there is a reasone for
> this.
><<
>
> I think an Indexed view may be a good alternative to a denormaled
> table, having the best of both worlds.

Indexed views can sometimes be used, that is correct, but there are
plenty of restrictions with indexed views, so it may not always work
out.

And speaking of denormalisations: in our database there is one table
that holds the current positions (in stocks, options, and other instruments)
and then there is another one for the current cash holdings. Furthermore,
there are historic tables that gives you the end-of-day standings for
both positions and cash. So what's denormal with this? These tables are
just a sum of the transactions table, so they are completely redudant.

Indexed view? I don't think so. A transaction has a book-record day (when
it was registered), a trade date (when the transaction took place) a
settle date (when it was actually paid) and a value date (from when it
affects the interest). And for cash holdings we have the values for each
of all these four dates, so that is four different aggregations.


--
Erland Sommarskog, SQL Server MVP, esquel@sommarskog.se

Books Online for SQL Server 2005 at
http://www.microsoft.com/technet/prodtechnol/sql/2005/downloads/books.mspx
Books Online for SQL Server 2000 at
http://www.microsoft.com/sql/prodinfo/previousversions/books.mspx

[Back to original message]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация