Showing posts with label cluster. Show all posts
Showing posts with label cluster. Show all posts

Wednesday, March 28, 2012

Information came from sql error log.

Hi,
Can someone explain the following info came from sql server error log? This
is the two node (active/passive) cluster SQL Server 2005 (with SP1) and OS is
Windows 2003 (64 bit, attached to SAN) named instance database server.
11/28/2006 12:10:21 PM [298] SQL Server Error: 10004, Communication link
failure [SQLSTATE 08S01]
11/28/2006 12:10:21 PM [298] SQL Server Error: 64, Communication link
failure [SQLSTATE 08S01]
11/28/2006 12:10:21 PM [298] SQL Server Error: 64, TCP Provider: The
specified network name is no longer available. [SQLSTATE 08S01]
Is above error means the net work not available for database instance while
application batch job running from other server connect to database server?
11/29/2006 2:05:06 AM SQL Server has encountered 4677 occurrence(s) of I/O
requests taking longer than 15 seconds to complete on file
[M:\bsi\data\bsi_Data.MDF] in database [bsi](5). The OS file handle is
0x00000000000009F4. The offset of the latest long I/O is: 0x000000badbc000
11/29/2006 2:47:39 AM SQL Server has encountered 993 occurrence(s) of I/O
requests taking longer than 15 seconds to complete on file
[M:\market_place\data\mp_orders_dat.ndf] in database [market_place](13). The
OS file handle is 0x0000000000000A9C. The offset of the latest long I/O is:
0x000000307e4c000
Is above info means the SAN drive is very busy and took long time to
complete the database processes such as query, insert, update and delete, etc?
Thanks!
Chen
Check this out;
http://blogs.msdn.com/sqlserverstorageengine/archive/2006/06/21/642314.aspx
Also review this KB article:
http://support.microsoft.com/default.aspx/kb/897284
Linchi
"Chen" wrote:

> Hi,
> Can someone explain the following info came from sql server error log? This
> is the two node (active/passive) cluster SQL Server 2005 (with SP1) and OS is
> Windows 2003 (64 bit, attached to SAN) named instance database server.
> 11/28/2006 12:10:21 PM [298] SQL Server Error: 10004, Communication link
> failure [SQLSTATE 08S01]
> 11/28/2006 12:10:21 PM [298] SQL Server Error: 64, Communication link
> failure [SQLSTATE 08S01]
> 11/28/2006 12:10:21 PM [298] SQL Server Error: 64, TCP Provider: The
> specified network name is no longer available. [SQLSTATE 08S01]
> Is above error means the net work not available for database instance while
> application batch job running from other server connect to database server?
> 11/29/2006 2:05:06 AM SQL Server has encountered 4677 occurrence(s) of I/O
> requests taking longer than 15 seconds to complete on file
> [M:\bsi\data\bsi_Data.MDF] in database [bsi](5). The OS file handle is
> 0x00000000000009F4. The offset of the latest long I/O is: 0x000000badbc000
> 11/29/2006 2:47:39 AM SQL Server has encountered 993 occurrence(s) of I/O
> requests taking longer than 15 seconds to complete on file
> [M:\market_place\data\mp_orders_dat.ndf] in database [market_place](13). The
> OS file handle is 0x0000000000000A9C. The offset of the latest long I/O is:
> 0x000000307e4c000
> Is above info means the SAN drive is very busy and took long time to
> complete the database processes such as query, insert, update and delete, etc?
> Thanks!
> Chen
>

Information came from sql error log.

Hi,
Can someone explain the following info came from sql server error log? This
is the two node (active/passive) cluster SQL Server 2005 (with SP1) and OS i
s
Windows 2003 (64 bit, attached to SAN) named instance database server.
11/28/2006 12:10:21 PM [298] SQL Server Error: 10004, Communication link
failure [SQLSTATE 08S01]
11/28/2006 12:10:21 PM [298] SQL Server Error: 64, Communication link
failure [SQLSTATE 08S01]
11/28/2006 12:10:21 PM [298] SQL Server Error: 64, TCP Provider: The
specified network name is no longer available. [SQLSTATE 08S01]
Is above error means the net work not available for database instance while
application batch job running from other server connect to database server?
11/29/2006 2:05:06 AM SQL Server has encountered 4677 occurrence(s) of I/O
requests taking longer than 15 seconds to complete on file
[M:\bsi\data\bsi_Data.MDF] in database [bsi](5). The OS file handle
is
0x00000000000009F4. The offset of the latest long I/O is: 0x000000badbc000
11/29/2006 2:47:39 AM SQL Server has encountered 993 occurrence(s) of I/O
requests taking longer than 15 seconds to complete on file
[M:\market_place\data\mp_orders_dat.ndf] in database [market_place](
13). The
OS file handle is 0x0000000000000A9C. The offset of the latest long I/O is:
0x000000307e4c000
Is above info means the SAN drive is very busy and took long time to
complete the database processes such as query, insert, update and delete, et
c?
Thanks!
ChenCheck this out;
http://blogs.msdn.com/sqlserverstor.../21/642314.aspx
Also review this KB article:
http://support.microsoft.com/default.aspx/kb/897284
Linchi
"Chen" wrote:

> Hi,
> Can someone explain the following info came from sql server error log? Thi
s
> is the two node (active/passive) cluster SQL Server 2005 (with SP1) and OS
is
> Windows 2003 (64 bit, attached to SAN) named instance database server.
> 11/28/2006 12:10:21 PM [298] SQL Server Error: 10004, Communication li
nk
> failure [SQLSTATE 08S01]
> 11/28/2006 12:10:21 PM [298] SQL Server Error: 64, Communication link
> failure [SQLSTATE 08S01]
> 11/28/2006 12:10:21 PM [298] SQL Server Error: 64, TCP Provider: The
> specified network name is no longer available. [SQLSTATE 08S01]
> Is above error means the net work not available for database instance whil
e
> application batch job running from other server connect to database server
?
> 11/29/2006 2:05:06 AM SQL Server has encountered 4677 occurrence(s) of I/O
> requests taking longer than 15 seconds to complete on file
> [M:\bsi\data\bsi_Data.MDF] in database [bsi](5). The OS file handl
e is
> 0x00000000000009F4. The offset of the latest long I/O is: 0x000000badbc000
> 11/29/2006 2:47:39 AM SQL Server has encountered 993 occurrence(s) of I/O
> requests taking longer than 15 seconds to complete on file
> [M:\market_place\data\mp_orders_dat.ndf] in database [market_place
](13). The
> OS file handle is 0x0000000000000A9C. The offset of the latest long I/O is
:
> 0x000000307e4c000
> Is above info means the SAN drive is very busy and took long time to
> complete the database processes such as query, insert, update and delete,
etc?
> Thanks!
> Chen
>sql

Monday, March 26, 2012

Info about Active/Active SQL 2000 Cluster

http://msdn.microsoft.com/library/default.asp?
url=/library/en-us/adminsql/ad_clustering_81ma.asp

>--Original Message--
>Hi all,
>i need configure a active/active SQL2000 cluster but i
don't have experience
>in this scenario
>The hardware and installation of MSCS di the same for the
active/passive
>configuration ?
>In active/active configuration i must install more SQL
virtual server (two)
>on the same node ?
>Thanks.
>
>.
>
Thanks,
but a last questions :
if i configure a active/active SQL Cluster may my web application may point
to virtual istance and the modified a date and a view the same data on the
both virtual SQL server ?
This mean active/active SQ cluster ?
bye
"Julie" <anonymous@.discussions.microsoft.com> wrote in message
news:11f5401c4423b$b8eadd40$a101280a@.phx.gbl...[vbcol=seagreen]
> http://msdn.microsoft.com/library/default.asp?
> url=/library/en-us/adminsql/ad_clustering_81ma.asp
>
> don't have experience
> active/passive
> virtual server (two)
|||Not unless you replicate the data between the 2 virtual servers...
An active/active cluster has a virtual server on EACH of the physical
servers... Each virtual server is alive and doing a piece of work ( like
one might be HR and the other the SHOPFloor server)... Each virtual server
can fail over to the other physical server... But they are otherwise NOT
related to one another... (unless YOU do something to move data between the
two)
Wayne Snyder, MCDBA, SQL Server MVP
Mariner, Charlotte, NC
www.mariner-usa.com
(Please respond only to the newsgroups.)
I support the Professional Association of SQL Server (PASS) and it's
community of SQL Server professionals.
www.sqlpass.org
<io.com> wrote in message news:%23ayW5OkQEHA.1620@.TK2MSFTNGP12.phx.gbl...
> Thanks,
> but a last questions :
> if i configure a active/active SQL Cluster may my web application may
point
> to virtual istance and the modified a date and a view the same data on the
> both virtual SQL server ?
> This mean active/active SQ cluster ?
> bye
>
> "Julie" <anonymous@.discussions.microsoft.com> wrote in message
> news:11f5401c4423b$b8eadd40$a101280a@.phx.gbl...
>
sql

Info about Active/Active SQL 2000 Cluster

http://msdn.microsoft.com/library/default.asp?
url=/library/en-us/adminsql/ad_clustering_81ma.asp

>--Original Message--
>Hi all,
>i need configure a active/active SQL2000 cluster but i
don't have experience
>in this scenario
>The hardware and installation of MSCS di the same for the
active/passive
>configuration ?
>In active/active configuration i must install more SQL
virtual server (two)
>on the same node ?
>Thanks.
>
>.
>Thanks,
but a last questions :
if i configure a active/active SQL Cluster may my web application may point
to virtual istance and the modified a date and a view the same data on the
both virtual SQL server ?
This mean active/active SQ cluster ?
bye
"Julie" <anonymous@.discussions.microsoft.com> wrote in message
news:11f5401c4423b$b8eadd40$a101280a@.phx
.gbl...[vbcol=seagreen]
> http://msdn.microsoft.com/library/default.asp?
> url=/library/en-us/adminsql/ad_clustering_81ma.asp
>
> don't have experience
> active/passive
> virtual server (two)|||Not unless you replicate the data between the 2 virtual servers...
An active/active cluster has a virtual server on EACH of the physical
servers... Each virtual server is alive and doing a piece of work ( like
one might be HR and the other the SHOPFloor server)... Each virtual server
can fail over to the other physical server... But they are otherwise NOT
related to one another... (unless YOU do something to move data between the
two)
Wayne Snyder, MCDBA, SQL Server MVP
Mariner, Charlotte, NC
www.mariner-usa.com
(Please respond only to the newsgroups.)
I support the Professional Association of SQL Server (PASS) and it's
community of SQL Server professionals.
www.sqlpass.org
<io.com> wrote in message news:%23ayW5OkQEHA.1620@.TK2MSFTNGP12.phx.gbl...
> Thanks,
> but a last questions :
> if i configure a active/active SQL Cluster may my web application may
point
> to virtual istance and the modified a date and a view the same data on the
> both virtual SQL server ?
> This mean active/active SQ cluster ?
> bye
>
> "Julie" <anonymous@.discussions.microsoft.com> wrote in message
> news:11f5401c4423b$b8eadd40$a101280a@.phx
.gbl...
>

Info about Active/Active SQL 2000 Cluster

Hi all,
i need configure a active/active SQL2000 cluster but i don't have experience
in this scenario
The hardware and installation of MSCS di the same for the active/passive
configuration ?
In active/active configuration i must install more SQL virtual server (two)
on the same node ?
Thanks.http://msdn.microsoft.com/library/default.asp?
url=/library/en-us/adminsql/ad_clustering_81ma.asp
>--Original Message--
>Hi all,
>i need configure a active/active SQL2000 cluster but i
don't have experience
>in this scenario
>The hardware and installation of MSCS di the same for the
active/passive
>configuration ?
>In active/active configuration i must install more SQL
virtual server (two)
>on the same node ?
>Thanks.
>
>.
>|||Thanks,
but a last questions :
if i configure a active/active SQL Cluster may my web application may point
to virtual istance and the modified a date and a view the same data on the
both virtual SQL server ?
This mean active/active SQç cluster ?
bye
"Julie" <anonymous@.discussions.microsoft.com> wrote in message
news:11f5401c4423b$b8eadd40$a101280a@.phx.gbl...
> http://msdn.microsoft.com/library/default.asp?
> url=/library/en-us/adminsql/ad_clustering_81ma.asp
>
> >--Original Message--
> >Hi all,
> >
> >i need configure a active/active SQL2000 cluster but i
> don't have experience
> >in this scenario
> >
> >The hardware and installation of MSCS di the same for the
> active/passive
> >configuration ?
> >
> >In active/active configuration i must install more SQL
> virtual server (two)
> >on the same node ?
> >
> >Thanks.
> >
> >
> >.
> >|||Not unless you replicate the data between the 2 virtual servers...
An active/active cluster has a virtual server on EACH of the physical
servers... Each virtual server is alive and doing a piece of work ( like
one might be HR and the other the SHOPFloor server)... Each virtual server
can fail over to the other physical server... But they are otherwise NOT
related to one another... (unless YOU do something to move data between the
two)
--
Wayne Snyder, MCDBA, SQL Server MVP
Mariner, Charlotte, NC
www.mariner-usa.com
(Please respond only to the newsgroups.)
I support the Professional Association of SQL Server (PASS) and it's
community of SQL Server professionals.
www.sqlpass.org
<io.com> wrote in message news:%23ayW5OkQEHA.1620@.TK2MSFTNGP12.phx.gbl...
> Thanks,
> but a last questions :
> if i configure a active/active SQL Cluster may my web application may
point
> to virtual istance and the modified a date and a view the same data on the
> both virtual SQL server ?
> This mean active/active SQç cluster ?
> bye
>
> "Julie" <anonymous@.discussions.microsoft.com> wrote in message
> news:11f5401c4423b$b8eadd40$a101280a@.phx.gbl...
> > http://msdn.microsoft.com/library/default.asp?
> > url=/library/en-us/adminsql/ad_clustering_81ma.asp
> >
> >
> > >--Original Message--
> > >Hi all,
> > >
> > >i need configure a active/active SQL2000 cluster but i
> > don't have experience
> > >in this scenario
> > >
> > >The hardware and installation of MSCS di the same for the
> > active/passive
> > >configuration ?
> > >
> > >In active/active configuration i must install more SQL
> > virtual server (two)
> > >on the same node ?
> > >
> > >Thanks.
> > >
> > >
> > >.
> > >
>

Info about A/A SQL 2000 cluster

Hi i need to configure 2 sql2000 server (S1 e S2) in a/a mode with two
database on the first node and other two database on the second node.
I have 3 Logical Unit SCSI on external diskarray
- q: quorum into "cluser group" with owner S1 Server
- r: dati1 into "Group 0" with owner S1 Server
- s: dati2 into "Group 1" with owner S1 Server
I now should install a SQL Virtual Server with SQL 2000 CD-ROM but how i
install virtual server for a/a mode ?
I read that i install first VS on the S1 Server and second VS on the S2
Server but how i can do it if all resource is locked is locked form S1
Server ?!?!?
How i set a datafile for VS on S1 to save to r: and datafile for VS on S2 to
save to s: if s: is locekd always from S1 server ?!?!?
Thanks in advance.
For every Active SQL you need another instance. In your case two instances
and two installs
Cheers,
Rod
<io.com> wrote in message news:%23qDH%23XlUEHA.2544@.TK2MSFTNGP10.phx.gbl...
> Hi i need to configure 2 sql2000 server (S1 e S2) in a/a mode with two
> database on the first node and other two database on the second node.
> I have 3 Logical Unit SCSI on external diskarray
> - q: quorum into "cluser group" with owner S1 Server
> - r: dati1 into "Group 0" with owner S1 Server
> - s: dati2 into "Group 1" with owner S1 Server
> I now should install a SQL Virtual Server with SQL 2000 CD-ROM but how i
> install virtual server for a/a mode ?
> I read that i install first VS on the S1 Server and second VS on the S2
> Server but how i can do it if all resource is locked is locked form S1
> Server ?!?!?
> How i set a datafile for VS on S1 to save to r: and datafile for VS on S2
to
> save to s: if s: is locekd always from S1 server ?!?!?
> Thanks in advance.
>
|||> For every Active SQL you need another instance. In your case two instances
> and two installs
Thanks but wjat do you think about this ?
I read that i install first VS on the S1 Server and second VS on the S2
Server but how i can do it if all resource is locked is locked form S1
Server ?!?!?
How i set a datafile for VS on S1 to save to r: and datafile for VS on S2
to save to s: if s: is locekd always from S1 server ?!?!?
Thanks in advance.
|||You run active/active with the Microsoft shared nothing model, each
instance/node will control its own group/disk drive. If you would like to
write to one database or the other, use T-SQL.
Cheers,
Rod
<io.com> wrote in message news:%23EjN8yqUEHA.3200@.TK2MSFTNGP10.phx.gbl...[vbcol=seagreen]
instances
> Thanks but wjat do you think about this ?
> I read that i install first VS on the S1 Server and second VS on the S2
> Server but how i can do it if all resource is locked is locked form S1
> Server ?!?!?
> How i set a datafile for VS on S1 to save to r: and datafile for VS on S2
> to save to s: if s: is locekd always from S1 server ?!?!?
> Thanks in advance.
>
|||Thanks Rodney,
but a last question :
How i do configure the cluster in "shared nothing model" !?!
From Cluster Administration / Cluster administration Wizard or during a SQL
installation ?
Thanks!
"Rodney R. Fournier [MVP]" <rod@.die.spam.die.nw-america.com> wrote in
message news:uHLonHtUEHA.3664@.TK2MSFTNGP12.phx.gbl...[vbcol=seagreen]
> You run active/active with the Microsoft shared nothing model, each
> instance/node will control its own group/disk drive. If you would like to
> write to one database or the other, use T-SQL.
> Cheers,
> Rod
> <io.com> wrote in message news:%23EjN8yqUEHA.3200@.TK2MSFTNGP10.phx.gbl...
> instances
S2
>
|||The shared nothing model is just the way things are. When you setup
Clustering and then SQL, both us this model.
Cheers,
Rod
<io.com> wrote in message news:OvXo5ytUEHA.2408@.tk2msftngp13.phx.gbl...
> Thanks Rodney,
> but a last question :
> How i do configure the cluster in "shared nothing model" !?!
> From Cluster Administration / Cluster administration Wizard or during a
SQL[vbcol=seagreen]
> installation ?
> Thanks!
>
> "Rodney R. Fournier [MVP]" <rod@.die.spam.die.nw-america.com> wrote in
> message news:uHLonHtUEHA.3664@.TK2MSFTNGP12.phx.gbl...
to[vbcol=seagreen]
news:%23EjN8yqUEHA.3200@.TK2MSFTNGP10.phx.gbl...[vbcol=seagreen]
S2
> S2
>

inedex - should I cluster?

Hi, I have the following delema:
I have a table that has the following fields:
companyid
warehouseid
year
month
productid
val1
...
valn
there are 3 companies, 15 warehouse, 4 year history, 12 months, 3000 prodocts.
the primary key is : companyid, warehouseid, year, month, productid
a) At the end of each month new values are recorded on the table.
b) During the month updates are issued to the current month.
c) queries are usualy include:
* company, warehouse, year, month
* company, year, month, product
Question: what is a good clusterd index for this table, what other indexes
should I implement.
Thx,
Juan"jccondor" <jccondor@.discussions.microsoft.com> wrote in message
news:1373BADF-2A63-4D61-853C-C6A9B894DF73@.microsoft.com...
> Hi, I have the following delema:
> I have a table that has the following fields:
> companyid
> warehouseid
> year
> month
> productid
> val1
> ...
> valn
> there are 3 companies, 15 warehouse, 4 year history, 12 months, 3000
> prodocts.
> the primary key is : companyid, warehouseid, year, month, productid
> a) At the end of each month new values are recorded on the table.
> b) During the month updates are issued to the current month.
> c) queries are usualy include:
> * company, warehouse, year, month
> * company, year, month, product
> Question: what is a good clusterd index for this table, what other indexes
> should I implement.
>
The primary key looks like a good clustered index. Since the queries
usually include the four leading PK columns (company, warehouse, year,
month), or the leading column and other PK columns (company, year, month,
product), a clustered PK will be helpful. Of course the updates will
specify the whole key.
For other indexes, look at the workload. You may want a secondary index on
(year,month) or (product).
David
David

Friday, March 23, 2012

inedex - should I cluster?

Hi, I have the following delema:
I have a table that has the following fields:
companyid
warehouseid
year
month
productid
val1
...
valn
there are 3 companies, 15 warehouse, 4 year history, 12 months, 3000 prodoct
s.
the primary key is : companyid, warehouseid, year, month, productid
a) At the end of each month new values are recorded on the table.
b) During the month updates are issued to the current month.
c) queries are usualy include:
* company, warehouse, year, month
* company, year, month, product
Question: what is a good clusterd index for this table, what other indexes
should I implement.
Thx,
Juan"jccondor" <jccondor@.discussions.microsoft.com> wrote in message
news:1373BADF-2A63-4D61-853C-C6A9B894DF73@.microsoft.com...
> Hi, I have the following delema:
> I have a table that has the following fields:
> companyid
> warehouseid
> year
> month
> productid
> val1
> ...
> valn
> there are 3 companies, 15 warehouse, 4 year history, 12 months, 3000
> prodocts.
> the primary key is : companyid, warehouseid, year, month, productid
> a) At the end of each month new values are recorded on the table.
> b) During the month updates are issued to the current month.
> c) queries are usualy include:
> * company, warehouse, year, month
> * company, year, month, product
> Question: what is a good clusterd index for this table, what other indexes
> should I implement.
>
The primary key looks like a good clustered index. Since the queries
usually include the four leading PK columns (company, warehouse, year,
month), or the leading column and other PK columns (company, year, month,
product), a clustered PK will be helpful. Of course the updates will
specify the whole key.
For other indexes, look at the workload. You may want a secondary index on
(year,month) or (product).
David
David

inedex - should I cluster?

Hi, I have the following delema:
I have a table that has the following fields:
companyid
warehouseid
year
month
productid
val1
...
valn
there are 3 companies, 15 warehouse, 4 year history, 12 months, 3000 prodocts.
the primary key is : companyid, warehouseid, year, month, productid
a) At the end of each month new values are recorded on the table.
b) During the month updates are issued to the current month.
c) queries are usualy include:
* company, warehouse, year, month
* company, year, month, product
Question: what is a good clusterd index for this table, what other indexes
should I implement.
Thx,
Juan
"jccondor" <jccondor@.discussions.microsoft.com> wrote in message
news:1373BADF-2A63-4D61-853C-C6A9B894DF73@.microsoft.com...
> Hi, I have the following delema:
> I have a table that has the following fields:
> companyid
> warehouseid
> year
> month
> productid
> val1
> ...
> valn
> there are 3 companies, 15 warehouse, 4 year history, 12 months, 3000
> prodocts.
> the primary key is : companyid, warehouseid, year, month, productid
> a) At the end of each month new values are recorded on the table.
> b) During the month updates are issued to the current month.
> c) queries are usualy include:
> * company, warehouse, year, month
> * company, year, month, product
> Question: what is a good clusterd index for this table, what other indexes
> should I implement.
>
The primary key looks like a good clustered index. Since the queries
usually include the four leading PK columns (company, warehouse, year,
month), or the leading column and other PK columns (company, year, month,
product), a clustered PK will be helpful. Of course the updates will
specify the whole key.
For other indexes, look at the workload. You may want a secondary index on
(year,month) or (product).
David
David
sql

Monday, March 19, 2012

Indexing non-unique data

I have two tables which are related. The first table(A) has a sequentially assigned unique key (primary) that has a cluster index built on it. This table has roughly 1,000,000 rows of data and grows daily.

The second table(B) has a sequentially assigned unique key (primary). There is a column in table(B) which contains table(A)'s unique key. For each row in the table(A) there are roughly 30 rows in table(B).

Should I build a clustered index on the table(B) column which contains the key to table(A) or a non-clustered index?You can have only one clustered index on a table, though you can have many non-clustered indexes. Since you may have many foreign keys in a table you can't make all these lookups clustered, so generally non-clustered indexes are applied to foreign keys.|||I have two tables which are related. The first table(A) has a sequentially assigned unique key (primary) that has a cluster index built on it. This table has roughly 1,000,000 rows of data and grows daily.

The second table(B) has a sequentially assigned unique key (primary). There is a column in table(B) which contains table(A)'s unique key. For each row in the table(A) there are roughly 30 rows in table(B).

Should I build a clustered index on the table(B) column which contains the key to table(A) or a non-clustered index?
I think custured index should do the trick,its my opinion...I feel clustered index are best for low selectiviy columns,i.e. the column which have many duplicates values. But see what the gurus suggest...|||You can have only one clustered index on a table, though you can have many non-clustered indexes. Since you may have many foreign keys in a table you can't make all these lookups clustered, so generally non-clustered indexes are applied to foreign keys.
But can't we make the foreign key column clustered index? I mean making the unique key not a clustered index...only a unique key column|||Hi Istaks

Welcome to the forum

Not a guru but some musings:

Well - a clustered index determines the physical order storage of data. So - it is useful if placed on an incrementing field as far as insertion of data is concerned as there will be no page splits based on insertion. It is also useful if you are likely to use >, < or between comparisons in a where condition on the clustered field.

The former is not the case. Inequality operators are rarely used on identities so Id go with no too :)|||So on table(B) create a clustered index on the unique key and a non-clustered index on the foreign key?

All selections from this table will be based on the foreign key.|||If ALL selects on this table will reference the foreign key and you will not be searching for individual records, then you would get a performance boost from using a clustered index on your foreign key.

Friday, February 24, 2012

Indexes

I have a SQL Server 2000 database with numerous cluster and non-cluster
indexes.
I have a stored procedure that has several queries. This stored procedure
has query that uses index B3 first and then another query that uses B4 index
.
What is the best practice to have two separate indexes or one index (B3/B4)
that used by this stored procedure?
Thank You,
Table A
B1 : Cluster
B2
B3 :Non-Cluster
B4 :Non-ClusterThere is no best practice in that regard. Use whatever indexes improve your
performance, but try not to create too many indexes or you will end up
hurting data modification performance.
Adam Machanic
Pro SQL Server 2005, available now
http://www.apress.com/book/bookDisplay.html?bID=457
--
"Joe K." <Joe K.@.discussions.microsoft.com> wrote in message
news:B66C6D12-3E2E-4171-AABB-6FA620517275@.microsoft.com...
> I have a SQL Server 2000 database with numerous cluster and non-cluster
> indexes.
> I have a stored procedure that has several queries. This stored procedure
> has query that uses index B3 first and then another query that uses B4
> index.
> What is the best practice to have two separate indexes or one index
> (B3/B4)
> that used by this stored procedure?
> Thank You,
>
> Table A
> B1 : Cluster
> B2
> B3 :Non-Cluster
> B4 :Non-Cluster
>
>

Indexes

I have cluster index created on a composite primary key (acct_key,period).
I would like to create a non-cluster index on the acct_key field, since
there are numerous sql statements that extract single value from this field.
Please let me know if cluster index has a composite primary key neither
field should be in a non-cluster index?A) If you already have a clustered index on (acct_key, period), there is no
reason to create a non-clustered index on acct_key.
B) Non-clustered indexes always contain the columns from the clustered
index.
Adam Machanic
Pro SQL Server 2005, available now
http://www.apress.com/book/bookDisplay.html?bID=457
--
"Joe K." <Joe K.@.discussions.microsoft.com> wrote in message
news:36B52E1A-429C-487E-8BA5-7CDE2417A3A2@.microsoft.com...
> I have cluster index created on a composite primary key (acct_key,period).
> I would like to create a non-cluster index on the acct_key field, since
> there are numerous sql statements that extract single value from this
> field.
> Please let me know if cluster index has a composite primary key neither
> field should be in a non-cluster index?
>|||> A) If you already have a clustered index on (acct_key, period), there is no reason to crea
te a
> non-clustered index on acct_key.
... unless you do it to cover queries.
Tibor Karaszi, SQL Server MVP
http://www.karaszi.com/sqlserver/default.asp
http://www.solidqualitylearning.com/
Blog: http://solidqualitylearning.com/blogs/tibor/
"Adam Machanic" <amachanic@.hotmail._removetoemail_.com> wrote in message
news:%23VCUMJ49FHA.3980@.TK2MSFTNGP14.phx.gbl...
> A) If you already have a clustered index on (acct_key, period), there is n
o reason to create a
> non-clustered index on acct_key.
> B) Non-clustered indexes always contain the columns from the clustered ind
ex.
>
> --
> Adam Machanic
> Pro SQL Server 2005, available now
> http://www.apress.com/book/bookDisplay.html?bID=457
> --
>
> "Joe K." <Joe K.@.discussions.microsoft.com> wrote in message
> news:36B52E1A-429C-487E-8BA5-7CDE2417A3A2@.microsoft.com...
>|||"Tibor Karaszi" <tibor_please.no.email_karaszi@.hotmail.nomail.com> wrote in
message news:OwxGFZ$9FHA.3308@.TK2MSFTNGP11.phx.gbl...
> ... unless you do it to cover queries.
You'd have to have a pretty wide table for that to make a difference --
the clustered index already covers every possible query...
Adam Machanic
Pro SQL Server 2005, available now
http://www.apress.com/book/bookDisplay.html?bID=457
--|||* every possible query that uses acct_key, that is.
Adam Machanic
Pro SQL Server 2005, available now
http://www.apress.com/book/bookDisplay.html?bID=457
--
"Adam Machanic" <amachanic@.hotmail._removetoemail_.com> wrote in message
news:eazdSDC%23FHA.2320@.TK2MSFTNGP11.phx.gbl...
> "Tibor Karaszi" <tibor_please.no.email_karaszi@.hotmail.nomail.com> wrote
> in message news:OwxGFZ$9FHA.3308@.TK2MSFTNGP11.phx.gbl...
> You'd have to have a pretty wide table for that to make a difference --
> the clustered index already covers every possible query...
>
> --
> Adam Machanic
> Pro SQL Server 2005, available now
> http://www.apress.com/book/bookDisplay.html?bID=457
> --
>|||Hmm, yes, assuming this is the only column to be in the nc index (which I no
w see was the case,
re-reading the OP). I was thrown off a bit by this:

I have difficulties understanding what "extract single values from this fiel
d" means. My thinking
was that the NC index could cover queries where the restriction is for some
other column than the
first column in the CL index (to enable nc ix scan instead of cl ix scan).
Tibor Karaszi, SQL Server MVP
http://www.karaszi.com/sqlserver/default.asp
http://www.solidqualitylearning.com/
Blog: http://solidqualitylearning.com/blogs/tibor/
"Adam Machanic" <amachanic@.hotmail._removetoemail_.com> wrote in message
news:%23bXUAbC%23FHA.4004@.TK2MSFTNGP14.phx.gbl...[vbcol=seagreen]
>* every possible query that uses acct_key, that is.
>
> --
> Adam Machanic
> Pro SQL Server 2005, available now
> http://www.apress.com/book/bookDisplay.html?bID=457
> --
>
> "Adam Machanic" <amachanic@.hotmail._removetoemail_.com> wrote in message
> news:eazdSDC%23FHA.2320@.TK2MSFTNGP11.phx.gbl...
>

Indexes

I have a SQL Server 2000 database with numerous cluster and non-cluster
indexes.
I have a stored procedure that has several queries. This stored procedure
has query that uses index B3 first and then another query that uses B4 index.
What is the best practice to have two separate indexes or one index (B3/B4)
that used by this stored procedure?
Thank You,
Table A
B1 : Cluster
B2
B3 :Non-Cluster
B4 :Non-ClusterThere is no best practice in that regard. Use whatever indexes improve your
performance, but try not to create too many indexes or you will end up
hurting data modification performance.
Adam Machanic
Pro SQL Server 2005, available now
http://www.apress.com/book/bookDisplay.html?bID=457
--
"Joe K." <Joe K.@.discussions.microsoft.com> wrote in message
news:B66C6D12-3E2E-4171-AABB-6FA620517275@.microsoft.com...
> I have a SQL Server 2000 database with numerous cluster and non-cluster
> indexes.
> I have a stored procedure that has several queries. This stored procedure
> has query that uses index B3 first and then another query that uses B4
> index.
> What is the best practice to have two separate indexes or one index
> (B3/B4)
> that used by this stored procedure?
> Thank You,
>
> Table A
> B1 : Cluster
> B2
> B3 :Non-Cluster
> B4 :Non-Cluster
>
>

Indexes

I have cluster index created on a composite primary key (acct_key,period).
I would like to create a non-cluster index on the acct_key field, since
there are numerous sql statements that extract single value from this field.
Please let me know if cluster index has a composite primary key neither
field should be in a non-cluster index?A) If you already have a clustered index on (acct_key, period), there is no
reason to create a non-clustered index on acct_key.
B) Non-clustered indexes always contain the columns from the clustered
index.
Adam Machanic
Pro SQL Server 2005, available now
http://www.apress.com/book/bookDisplay.html?bID=457
--
"Joe K." <Joe K.@.discussions.microsoft.com> wrote in message
news:36B52E1A-429C-487E-8BA5-7CDE2417A3A2@.microsoft.com...
> I have cluster index created on a composite primary key (acct_key,period).
> I would like to create a non-cluster index on the acct_key field, since
> there are numerous sql statements that extract single value from this
> field.
> Please let me know if cluster index has a composite primary key neither
> field should be in a non-cluster index?
>|||> A) If you already have a clustered index on (acct_key, period), there is no reason to create a
> non-clustered index on acct_key.
... unless you do it to cover queries.
--
Tibor Karaszi, SQL Server MVP
http://www.karaszi.com/sqlserver/default.asp
http://www.solidqualitylearning.com/
Blog: http://solidqualitylearning.com/blogs/tibor/
"Adam Machanic" <amachanic@.hotmail._removetoemail_.com> wrote in message
news:%23VCUMJ49FHA.3980@.TK2MSFTNGP14.phx.gbl...
> A) If you already have a clustered index on (acct_key, period), there is no reason to create a
> non-clustered index on acct_key.
> B) Non-clustered indexes always contain the columns from the clustered index.
>
> --
> Adam Machanic
> Pro SQL Server 2005, available now
> http://www.apress.com/book/bookDisplay.html?bID=457
> --
>
> "Joe K." <Joe K.@.discussions.microsoft.com> wrote in message
> news:36B52E1A-429C-487E-8BA5-7CDE2417A3A2@.microsoft.com...
>> I have cluster index created on a composite primary key (acct_key,period).
>> I would like to create a non-cluster index on the acct_key field, since
>> there are numerous sql statements that extract single value from this field.
>> Please let me know if cluster index has a composite primary key neither
>> field should be in a non-cluster index?
>>
>|||"Tibor Karaszi" <tibor_please.no.email_karaszi@.hotmail.nomail.com> wrote in
message news:OwxGFZ$9FHA.3308@.TK2MSFTNGP11.phx.gbl...
>> A) If you already have a clustered index on (acct_key, period), there is
>> no reason to create a non-clustered index on acct_key.
> ... unless you do it to cover queries.
You'd have to have a pretty wide table for that to make a difference --
the clustered index already covers every possible query...
Adam Machanic
Pro SQL Server 2005, available now
http://www.apress.com/book/bookDisplay.html?bID=457
--|||* every possible query that uses acct_key, that is.
Adam Machanic
Pro SQL Server 2005, available now
http://www.apress.com/book/bookDisplay.html?bID=457
--
"Adam Machanic" <amachanic@.hotmail._removetoemail_.com> wrote in message
news:eazdSDC%23FHA.2320@.TK2MSFTNGP11.phx.gbl...
> "Tibor Karaszi" <tibor_please.no.email_karaszi@.hotmail.nomail.com> wrote
> in message news:OwxGFZ$9FHA.3308@.TK2MSFTNGP11.phx.gbl...
>> A) If you already have a clustered index on (acct_key, period), there is
>> no reason to create a non-clustered index on acct_key.
>> ... unless you do it to cover queries.
> You'd have to have a pretty wide table for that to make a difference --
> the clustered index already covers every possible query...
>
> --
> Adam Machanic
> Pro SQL Server 2005, available now
> http://www.apress.com/book/bookDisplay.html?bID=457
> --
>|||Hmm, yes, assuming this is the only column to be in the nc index (which I now see was the case,
re-reading the OP). I was thrown off a bit by this:
>> I would like to create a non-cluster index on the acct_key field, since
>> there are numerous sql statements that extract single value from this field.
I have difficulties understanding what "extract single values from this field" means. My thinking
was that the NC index could cover queries where the restriction is for some other column than the
first column in the CL index (to enable nc ix scan instead of cl ix scan).
--
Tibor Karaszi, SQL Server MVP
http://www.karaszi.com/sqlserver/default.asp
http://www.solidqualitylearning.com/
Blog: http://solidqualitylearning.com/blogs/tibor/
"Adam Machanic" <amachanic@.hotmail._removetoemail_.com> wrote in message
news:%23bXUAbC%23FHA.4004@.TK2MSFTNGP14.phx.gbl...
>* every possible query that uses acct_key, that is.
>
> --
> Adam Machanic
> Pro SQL Server 2005, available now
> http://www.apress.com/book/bookDisplay.html?bID=457
> --
>
> "Adam Machanic" <amachanic@.hotmail._removetoemail_.com> wrote in message
> news:eazdSDC%23FHA.2320@.TK2MSFTNGP11.phx.gbl...
>> "Tibor Karaszi" <tibor_please.no.email_karaszi@.hotmail.nomail.com> wrote in message
>> news:OwxGFZ$9FHA.3308@.TK2MSFTNGP11.phx.gbl...
>> A) If you already have a clustered index on (acct_key, period), there is no reason to create a
>> non-clustered index on acct_key.
>> ... unless you do it to cover queries.
>> You'd have to have a pretty wide table for that to make a difference -- the clustered index
>> already covers every possible query...
>>
>> --
>> Adam Machanic
>> Pro SQL Server 2005, available now
>> http://www.apress.com/book/bookDisplay.html?bID=457
>> --
>>
>

Sunday, February 19, 2012

Indexes

I have cluster index created on a composite primary key (acct_key,period).
I would like to create a non-cluster index on the acct_key field, since
there are numerous sql statements that extract single value from this field.
Please let me know if cluster index has a composite primary key neither
field should be in a non-cluster index?
A) If you already have a clustered index on (acct_key, period), there is no
reason to create a non-clustered index on acct_key.
B) Non-clustered indexes always contain the columns from the clustered
index.
Adam Machanic
Pro SQL Server 2005, available now
http://www.apress.com/book/bookDisplay.html?bID=457
"Joe K." <Joe K.@.discussions.microsoft.com> wrote in message
news:36B52E1A-429C-487E-8BA5-7CDE2417A3A2@.microsoft.com...
> I have cluster index created on a composite primary key (acct_key,period).
> I would like to create a non-cluster index on the acct_key field, since
> there are numerous sql statements that extract single value from this
> field.
> Please let me know if cluster index has a composite primary key neither
> field should be in a non-cluster index?
>
|||> A) If you already have a clustered index on (acct_key, period), there is no reason to create a
> non-clustered index on acct_key.
... unless you do it to cover queries.
Tibor Karaszi, SQL Server MVP
http://www.karaszi.com/sqlserver/default.asp
http://www.solidqualitylearning.com/
Blog: http://solidqualitylearning.com/blogs/tibor/
"Adam Machanic" <amachanic@.hotmail._removetoemail_.com> wrote in message
news:%23VCUMJ49FHA.3980@.TK2MSFTNGP14.phx.gbl...
> A) If you already have a clustered index on (acct_key, period), there is no reason to create a
> non-clustered index on acct_key.
> B) Non-clustered indexes always contain the columns from the clustered index.
>
> --
> Adam Machanic
> Pro SQL Server 2005, available now
> http://www.apress.com/book/bookDisplay.html?bID=457
> --
>
> "Joe K." <Joe K.@.discussions.microsoft.com> wrote in message
> news:36B52E1A-429C-487E-8BA5-7CDE2417A3A2@.microsoft.com...
>
|||"Tibor Karaszi" <tibor_please.no.email_karaszi@.hotmail.nomail.com> wrote in
message news:OwxGFZ$9FHA.3308@.TK2MSFTNGP11.phx.gbl...
> ... unless you do it to cover queries.
You'd have to have a pretty wide table for that to make a difference --
the clustered index already covers every possible query...
Adam Machanic
Pro SQL Server 2005, available now
http://www.apress.com/book/bookDisplay.html?bID=457
|||* every possible query that uses acct_key, that is.
Adam Machanic
Pro SQL Server 2005, available now
http://www.apress.com/book/bookDisplay.html?bID=457
"Adam Machanic" <amachanic@.hotmail._removetoemail_.com> wrote in message
news:eazdSDC%23FHA.2320@.TK2MSFTNGP11.phx.gbl...
> "Tibor Karaszi" <tibor_please.no.email_karaszi@.hotmail.nomail.com> wrote
> in message news:OwxGFZ$9FHA.3308@.TK2MSFTNGP11.phx.gbl...
> You'd have to have a pretty wide table for that to make a difference --
> the clustered index already covers every possible query...
>
> --
> Adam Machanic
> Pro SQL Server 2005, available now
> http://www.apress.com/book/bookDisplay.html?bID=457
> --
>
|||Hmm, yes, assuming this is the only column to be in the nc index (which I now see was the case,
re-reading the OP). I was thrown off a bit by this:
[vbcol=seagreen]
I have difficulties understanding what "extract single values from this field" means. My thinking
was that the NC index could cover queries where the restriction is for some other column than the
first column in the CL index (to enable nc ix scan instead of cl ix scan).
Tibor Karaszi, SQL Server MVP
http://www.karaszi.com/sqlserver/default.asp
http://www.solidqualitylearning.com/
Blog: http://solidqualitylearning.com/blogs/tibor/
"Adam Machanic" <amachanic@.hotmail._removetoemail_.com> wrote in message
news:%23bXUAbC%23FHA.4004@.TK2MSFTNGP14.phx.gbl...
>* every possible query that uses acct_key, that is.
>
> --
> Adam Machanic
> Pro SQL Server 2005, available now
> http://www.apress.com/book/bookDisplay.html?bID=457
> --
>
> "Adam Machanic" <amachanic@.hotmail._removetoemail_.com> wrote in message
> news:eazdSDC%23FHA.2320@.TK2MSFTNGP11.phx.gbl...
>

Indexes

I have a SQL Server 2000 database with numerous cluster and non-cluster
indexes.
I have a stored procedure that has several queries. This stored procedure
has query that uses index B3 first and then another query that uses B4 index.
What is the best practice to have two separate indexes or one index (B3/B4)
that used by this stored procedure?
Thank You,
Table A
B1 : Cluster
B2
B3 :Non-Cluster
B4 :Non-Cluster
There is no best practice in that regard. Use whatever indexes improve your
performance, but try not to create too many indexes or you will end up
hurting data modification performance.
Adam Machanic
Pro SQL Server 2005, available now
http://www.apress.com/book/bookDisplay.html?bID=457
"Joe K." <Joe K.@.discussions.microsoft.com> wrote in message
news:B66C6D12-3E2E-4171-AABB-6FA620517275@.microsoft.com...
> I have a SQL Server 2000 database with numerous cluster and non-cluster
> indexes.
> I have a stored procedure that has several queries. This stored procedure
> has query that uses index B3 first and then another query that uses B4
> index.
> What is the best practice to have two separate indexes or one index
> (B3/B4)
> that used by this stored procedure?
> Thank You,
>
> Table A
> B1 : Cluster
> B2
> B3 :Non-Cluster
> B4 :Non-Cluster
>
>