query against vldb
From: Peja (anonymous_at_discussions.microsoft.com)
Date: 05/12/04
- Next message: AlexS: "Re: query against vldb"
- Previous message: Jami Bradley: "Re: Table with multi-record comments"
- Next in thread: AlexS: "Re: query against vldb"
- Reply: AlexS: "Re: query against vldb"
- Reply: Adam Machanic: "Re: query against vldb"
- Messages sorted by: [ date ] [ thread ]
Date: Wed, 12 May 2004 09:56:34 -0700
Hi,
we have 1.1 TB database, stored on sql server 2000, 4
procs, 6GB of memory (5GB assigned to sql server). I have
one query to tune. I got it to response time of 1.5
hours, but it is not acceptable. Statistics are updated
when creating indexes, and after that database is being
put into read_only mode. Does anybody have an idea what
else can be done?
Below is the query. Two bigest tables are A and B (10GB
and 8GB). Both have clustered indexes created on ID
columns. "A" table also has separate nonclustered index
for each CODE_ column. "G" table has 10,000 rows (query
optimizer starts from join between A and G - and it goes
into A clustered index scan).
SELECT A.CODE,
A.ADDRESS,
A.CITY,
A.PROVINCE,
A.ZIP,
A.MAIL_ZIP AS "MAIL ZIP",
C.DESCRIPTION,
A.NUMBER,
D.DESCRIPTION,
E.DESCRIPTION,
A.TOTAL,
F.DESCRIPTION,
A.DESCRIPTION,
A.DIG_CODE,
G.DESCRIPTION,
A.REGDATE
FROM DEVICE A LEFT JOIN POPS C
ON A.CODE_POPS=C.CODE
LEFT JOIN TARS D
ON A.CODE_TAR=D.CODE
LEFT OUTER JOIN CCD F
ON A.CODE_CCD=F.CODE
JOIN STAT G
ON A.CODE_STAT=G.CODE
LEFT OUTER JOIN COMP B
ON A.ID=B.ID
WHERE
B.ID1 = '165985890' OR
B.ID2 = '165985895' OR
B.ID3 = '165985899' OR
B.ID4 = '165985990'
Thanks,
Peja
- Next message: AlexS: "Re: query against vldb"
- Previous message: Jami Bradley: "Re: Table with multi-record comments"
- Next in thread: AlexS: "Re: query against vldb"
- Reply: AlexS: "Re: query against vldb"
- Reply: Adam Machanic: "Re: query against vldb"
- Messages sorted by: [ date ] [ thread ]
Relevant Pages
|