all groups > sql server data warehouse > february 2004 >
You're in the

sql server data warehouse

group:

clustered index or simple constraint in a fact table?


clustered index or simple constraint in a fact table? Jéjé
2/28/2004 3:07:18 PM
sql server data warehouse:
Hi,

What do you recommand to insure the integrity of a fact table?
a cluster index?
or a constraint?
or an SQL script?

do you recommand to allways having a clustering index on a fact table? or
just on the dimension tables and 1 index by linked column in the fact table?

I don't want to test each possibility, so I want your help ;)

Jerome.



---
Outgoing mail is certified Virus Free.
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.600 / Virus Database: 381 - Release Date: 2004-02-28

Re: clustered index or simple constraint in a fact table? Ray Higdon
2/28/2004 6:40:50 PM
What do you mean by integrity? A clustered index does not have to be unique.
There are very few times I will have any table without a clustered index, DW
or OLTP.

Linked column? Do you mean a foreign key?

--
Ray Higdon MCSE, MCDBA, CCNA
---
[quoted text, click to view]

Re: clustered index or simple constraint in a fact table? Ray Higdon
2/28/2004 7:50:26 PM
Also, these links may help

http://www.microsoft.com/sql/techinfo/administration/2000/security/default.asp

http://www.sql-server-performance.com/olap_performance.asp

--
Ray Higdon MCSE, MCDBA, CCNA
---
[quoted text, click to view]

Re: clustered index or simple constraint in a fact table? Jéjé
2/29/2004 8:51:03 AM
Yes, sorry, I talk about a unique clustered index.
Actually my fact table has a primary key which used all the foreign key
columns.

I've set all my indexes in a separate file to improove the performance, but
because Most part of the time, SQL Server used the cluster index instead-of
using the other indexes, the indexes files are not used, so no performance
improovment..

If I drop the cluster index and keep only the indexes associated with each
foreign key cloumn, the queries are not rightly optimized and SQL don't used
some indexes.

Fact table
- ForeKey1 --> idx 1
- ForeKey2 --> idx 2
- ForeKey3 --> idx 3
- ForeKey4 --> idx 4
- Measure 1
- Measure 2

My usage is not an OLAP cube, but only a reporting tool.

Well, I'm disapointed when I see how SQL Server optimize the queries. Also
the query plan never represent the real value of the result produce by the
query but my statistics are created and updated.

So I work to optimize all of this.

Thanks for your guide.

"Ray Higdon" <sqlhigdon@nospam.yahoo.com> a écrit dans le message de
news:%233W1VNl$DHA.2632@TK2MSFTNGP12.phx.gbl...
[quoted text, click to view]


---
Outgoing mail is certified Virus Free.
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.600 / Virus Database: 381 - Release Date: 2004-02-28

Re: clustered index or simple constraint in a fact table? Ray Higdon
2/29/2004 10:14:57 AM
It depends on your queries as to what will be used. Be aware that clustered
indexes sit at the leaf level of the data so you can not split them up. How
are you determining that the queries are not optimized? The best way I've
found for this is to use the "set statistics IO on" command and look at
logical IO, which is the number of times a page is hit (not number of
pages). You might post your queries and we can look at why optimizer may
choose one over the other.

--
Ray Higdon MCSE, MCDBA, CCNA
---
[quoted text, click to view]

Re: clustered index or simple constraint in a fact table? Jéjé
2/29/2004 10:57:11 PM
there is too many queries
because the users can creates the queries they want on the fly.

there is some predefined reports, and I'll optimize these specific reports

so a user can filter on 1 or more columns, links 1 or more dimension tables
etc...
Also I've a lot of distinct count measures

I'll check the IO stats this week

"Ray Higdon" <sqlhigdon@nospam.yahoo.com> a écrit dans le message de
news:eDtNUXt$DHA.2216@TK2MSFTNGP10.phx.gbl...
[quoted text, click to view]


---
Outgoing mail is certified Virus Free.
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.600 / Virus Database: 381 - Release Date: 2004-02-28

AddThis Social Bookmark Button