Mr Tea
3/27/2007 9:59:00 PM
Hi Mike
If search performance is paramount and storage space is unimportant and
there will be minumum inserts/updates on the tables then I would be tempted
to blanket index the table, examples of queries that will use each index are
supplied. indexing in this fashion will reduce the need for sorting and
bookmark lookups(possibly reverting to table scans) which would be the most
likely performance hindering operations on your large simple tables.
Although you are trading off storage space and write performance for these
gains.
e.g.
PK (clustered): id
(a clustered-unique index will minimise the space required by subsequent
indexes)
IX_1: emailsender, emailreceiver, date
(existance/counts of records by sender to named receivers, optionally by
date)
IX_2: emailsender, date, emailreceiver
(lists/counts of records by sender by date or ordered by date)
IX_3: emailreceiver, emailsender, date
(existance/counts of records by receiver from named senders, optionally by
date)
IX_4: emailreceiver, date, emailsender
(lists/counts of records by receiver by date or ordered by date)
IX_5: date, emailsender, emailreceiver
(lists/counts of records by date)
IX_6: listed but not required due to granularity of the date field
If you can afford the drive space covering indexes in this fashion, that I
would hope that your queries would be blisteringly fast on almost any
hardware, and make sure you are making good use of the memory capacity you
have available.
Regards
Lee
"MikeJohnson" <mikejohnson@volcanomail.com> wrote in message
news:1175022390.586577.35490@o5g2000hsb.googlegroups.com...
> Hi,
>
> We have a very large SQL Server database of around 2-3 Billion
> records.
> Each table holds hundreds of millions of records.
>
> Each table has the same simple schema:
>
> emailsender: varchar (255),
> emailreceiver: varchar (255),
> date: datetime
> id: bigint (identity key- unused by us)
>
> The tables won't change much once populated.
>
> Search performance is paramount.
>
> Queries will be like: "Were there emails from Joe to Mary in 2003?"
>
> Could you please recommend the best indexing strategy?
> We are happy to use more storage in return for faster searches.
>
> Would you have any other hardware and/or software recommendations?
>
> The hardware is a 4-CPU dual-core Windows Server 2003 machine.
> Because of the amount of data, storage is on a fiber-attached SAN.
>
> Thanks very much for any advice or recommendations!
>
> Sincerely,
> Mike Johnson
>