Missing Or Invalid Key In Index

May 19, 2005

Hi,
I run a nightly dbcc checktable on order_header and today I see this error occurs.
Table error: Table 'ORDER_HEADER' (ID 203147769). Missing or invalid key in index 'PK_ORDER_HEADER' (ID 4) for the row:
Server: Msg 8955, Level 16, State 1, Line 1
1. I have no idea what caused it?
2. How do I fixed this online as the application is 24/7?
3. I did try to dbcc reindex but it failed reporting that can't create index because of duplicate in primary index key????

Please show me a way to fix this.

Thanks
Dave

View 2 Replies


ADVERTISEMENT

Missing Or Invalid Key In Index

Mar 12, 2007

Dear all,

We have such problems:
DBCC results for 'TRAMES'.
Server: Msg 8955, Level 16, State 1, Line 1
Data row (1:3893993:34) identified by (RID = (1:3893993:34) ) has index values (PO_ID = 80123).
Server: Msg 8951, Level 16, State 1, Line 1
Table error: Table 'TRAMES' (ID 1573580644). Missing or invalid key in index 'IX_POID' (ID 2) for the row:
Server: Msg 8955, Level 16, State 1, Line 1
Data row (1:3893993:48) identified by (RID = (1:3893993:48) ) has index values (PO_ID = 80095).
Server: Msg 8951, Level 16, State 1, Line 1
Table error: Table 'TRAMES' (ID 1573580644). Missing or invalid key in index 'IX_POID' (ID 2) for the row:
Server: Msg 8955, Level 16, State 1, Line 1
Data row (1:3893993:79) identified by (RID = (1:3893993:79) ) has index values (PO_ID = 80123).
Server: Msg 8951, Level 16, State 1, Line 1
Table error: Table 'TRAMES' (ID 1573580644). Missing or invalid key in index 'IX_POID' (ID 2) for the row:
Server: Msg 8955, Level 16, State 1, Line 1
Data row (1:3893993:92) identified by (RID = (1:3893993:92) ) has index values (PO_ID = 80095).
There are 1703901 rows in 18180 pages for object 'TRAMES'.
CHECKDB found 0 allocation errors and 4 consistency errors in table 'TRAMES' (object ID 1573580644).

And really I don't know what can I do to prevent such problems. I know how to fix it with a dbreindex, but it blocks the production during several minutes, and we have to restart the whole plant...

we are using SQL 2000 standard edition 8.00.2039 (with SP4)

Thank you,
regards

Olivier

View 2 Replies View Related

SQLDescribeParam With Subselect: Invalid Parameter Number/Invalid Descriptor Index

Apr 21, 2008

Hello,

I've got the following query:

SELECT zA."ID" AS fA_A
, zA."TEXT" AS fA_B
, (
SELECT COUNT(zC."ID")
FROM Test."Booking" AS zC
) AS fA_E
FROM Test."Stack" AS zA
WHERE zA."ID" = ?

With this query I call:
- SQLPrepare -> SQL_SUCCESS=0
- SQLNumParams -> SQL_SUCCESS=0, pcpar = 1
- SQLDescribeParam( 1 ) -> SQL_ERROR=-1, [Microsoft][ODBC SQL Server Driver]Invalid parameter number", "[Microsoft][ODBC SQL Server Driver]Invalid Descriptor Index"

Is there a problem with this calling sequence or this query? Or is this a problem of SQL Server?

Regards
Markus

View 7 Replies View Related

Missing Or Invalid Keys

Sep 27, 2005

Hi,

We are getting index problems on 2 of our tables. The corruptions are intermittent and only started occurring on 22 Aug. We have been told by our customer that no changes have occurred on their systems recently, and I know that I haven't put anything new into the application either.

Our customer is running (@@Version)
Microsoft SQL Server 2000 - 8.00.534 (Intel X86) Nov 19 2001 13:23:50 Copyright (c) 1988-2000 Microsoft Corporation Enterprise Edition on Windows NT 5.0 (Build 2195: Service Pack 4)

Some Questions please.

1. Is there anyway that the application could be causing the corruption.
I have seen this from Paul Randal

"Not possible ever for an app bug to cause database corruption - no matter how hard it tries.

Paul Randal
Dev Lead, Microsoft SQL Server Storage Engine"

Please forgive any unintended insult, but does Paul actually work for Microsoft on this product? I have seen some of his replies and he seems highly, highly conversant with the product and given my limited knowledge of SQL and DB in general I agree that the application should not be able to cause this problem. I need to be able to demonstrate this to both my boss and our customer and a statement like the above from Paul would go a long way to providing the proof I need.

2. Why would the problem suddenly start on 22 Aug and happen regularly thereafter, given that there is supposedly no change to SQL or the application.

We have not been able to replicate the problem in the test region, even though we are able to process the production files there. The customer is reluctant to start full SQL logging given the performance hit.

We have a program which accepts a file of SQL statements and processes them. The input file can be up to about 50Mb and contain many thousands of statements. The structure of the file is this and the program just parses each statement between the <PGMBCL> and sends it to SQL


<PGMBCL>
DELETE FROM HRQUAARI.ZY8C WHERE NUDOSS = +714307848
<PGMBCL>
INSERT INTO HRQUAARI.ZY8C (NUDOSS,NULIGN,SOCDOS,FILLE1,PERTRT,FILLE2,NUM
TRT,NUMBUL,NUMCUM,CUMANN,CUMPER,DATCUM,MONCUM,IDCY00) VALUES ( +714307848, +0000
01, 'OCM', '20', '0506', ' ', '0', '01', '178', '01', '10', '1753-01-01', +00000
008072.2200, ' ')
etc.. another 36 records ..etc
<PGMBCL>
DELETE FROM HRQUAARI.ZYTD12 WHERE NUDOSS = +714307848 AND CDINFO = '8C'
<PGMBCL>
INSERT INTO HRQUAARI.ZYTD12 (NUDOSS,CDINFO,TIMJIF,TEVERO,NOMBRE,NULMAX,NUC
MAX) VALUES ( +714307848, '8C', '2005-09-23-14.36.05', '0', +00037, +000037, +00
0037)

and the DBCC CHECKTABLE ('HRUKPARI.ZY8c') results are :-


Server: Msg 8952, Level 16, State 1, Line 1
Table error: Database 'HRUKPARI', index 'HRUKPARI.ZY8C.X1ZY8C' (ID 112771509) (index ID 2). Extra or invalid key for the keys:
Server: Msg 8956, Level 16, State 1, Line 1
Index row (1:1462733:47) with values (NUDOSS = 712430859 and NULIGN = 48) points to the data row identified by (RID = (1:1453030:105)).
Server: Msg 8952, Level 16, State 1, Line 1
Table error: Database 'HRUKPARI', index 'HRUKPARI.ZY8C.X1ZY8C' (ID 112771509) (index ID 2). Extra or invalid key for the keys:
Server: Msg 8956, Level 16, State 1, Line 1
Index row (1:1468453:32) with values (NUDOSS = 712430858 and NULIGN = 50) points to the data row identified by (RID = (1:1453030:104)).
Server: Msg 8952, Level 16, State 1, Line 1
Table error: Database 'HRUKPARI', index 'HRUKPARI.ZY8C.X2ZY8C' (ID 112771509) (index ID 3). Extra or invalid key for the keys:
Server: Msg 8956, Level 16, State 1, Line 1
Index row (1:1064449:83) with values (NUDOSS = 712430858 and FILLE1 = '20' and PERTRT = '0507' and FILLE2 = ' ' and NUMTRT = '0' and NUMBUL = '01' and NUMCUM = '958' and CUMANN = '02' and CUMPER = '01' and DATCUM = Jan 1 1753 12:00AM) points to the data row identified by (RID = (1:1453030:104)).
Server: Msg 8952, Level 16, State 1, Line 1
Table error: Database 'HRUKPARI', index 'HRUKPARI.ZY8C.X2ZY8C' (ID 112771509) (index ID 3). Extra or invalid key for the keys:
Server: Msg 8956, Level 16, State 1, Line 1
Index row (1:1463770:32) with values (NUDOSS = 712430859 and FILLE1 = '20' and PERTRT = '0507' and FILLE2 = ' ' and NUMTRT = '0' and NUMBUL = '01' and NUMCUM = '958' and CUMANN = '04' and CUMPER = '01' and DATCUM = Jan 1 1753 12:00AM) points to the data row identified by (RID = (1:1453030:105)).
DBCC results for 'HRUKPARI.ZY8C'.
There are 352118 rows in 2656 pages for object 'HRUKPARI.ZY8C'.
CHECKTABLE found 0 allocation errors and 4 consistency errors in table 'HRUKPARI.ZY8C' (object ID 112771509).
repair_fast is the minimum repair level for the errors found by DBCC CHECKTABLE (HRUKPARI.HRUKPARI.ZY8C ).

View 3 Replies View Related

Invalid Descriptor Index Error

Oct 2, 2006

I'm testing db to db transactional replication on a box ( all on the same box ) and the distribution agent fails with the above error. I know it's something to do with the physical server as this test works on other servers fine. SQL2k Ent sp4 on w2k3 ent sp1. ( clustered )

Server and Agent accounts are in local admins, tried push and pull, named and anonymous. Replication also fails if I use the default snapshot location. I suspect policy restrictions ( maybe on the sql service accounts ) Any pointers would be helpful - there are no errors other than above, sadly.

View 12 Replies View Related

Invalid Descriptor Index (and ODBC Questions)

Feb 27, 2002

We recently upgraded a SQL 7.0 SP2 database to SQL 2000 SP2. The web server that connects to both databases (we have 2 up that we can switch back and forth) is Win2K with the SQL Server ODBC driver of 2000.80.194.00 (I'm thinking this came w/ W2K) But I think I installed the 7.0 client connectivity on the web server.

I have a few questions:
1. Any reason why this would happen with the SQL upgrade?
2. What is the ideal situation for client/server ODBC drivers / MDAC client.. If I have a SQL 2000 SP2 server do I install SQL 2000 client on the web server and also the service pack on the web server?

Thanks and please ask if you need more info..
-Kelly

View 1 Replies View Related

Invalid Descriptor Index Calling SQLGetData

Mar 10, 2006

In previous versions of MSSQL and on every other SQL engine I've tried the following pseudo-code works.



SQLExecDirect('select employeeid, photo, notes from employees where employeeid = 1')

SQLFetch()

SQLGetData(for column 3)

SQLGetData(for column 2)

With the Native Client I get an error 07009 "[Microsoft][SQL Native Client]Invalid Descriptor Index"

Is this a bug in the Native Client or am I making an incorrect assumption that I can get data in any order?

View 3 Replies View Related

SQLDescribeParam Returning Invalid Descriptor Index

May 23, 2007

We've run into a problem using SQLDescribeParam with the SQL Server ODBC driver (or SQL Native Client driver). The basic sequence that shows the issue is this:

SQLPrepare(select * from foo where col1 = ?)
SQLDescribeParam(1)
SQLBindParameter(1)
SQLFreeStmt(SQL_CLOSE) /* NOT RESET_PARAMS */
SQLPrepare(select * from foo where col1 = ? and col2 = ?)
SQLDescribeParam(1)
SQLDescribeParam(2) ==> returns "Invalid Descriptor Index"

If I leave out the SQLBindParameter, then the last SQLDescribeParam works just fine. Also, if I make the SQLFreeStmt use SQL_RESET_PARAMS then it works fine. However, I don't have direct control over the ODBC code being used, so I wanted to see if this known behavior. I've tried a couple of other ODBC drivers that support SQLDescribeParam and they work fine with the above sequence.



Thanks,

Chris

View 1 Replies View Related

Same Order Doesn't Work - Invalid Descriptor Index

Dec 28, 2005

Hi all,

I'm getting this "invalid descriptor index" exception while trying to fetch a record from the table.
The query is "select * from <tablename> where <columnname> = 'xyz'". The column name is correct and indeed a record with 'xyz' value exists. The record is getting fetched too...! But I'm having this particular error while trying to retrieve a couple of fields with rs.getString().
The order of columns in the table is same as the order in which I'm retrieving them. And I'm not facing any problem retrieving another field which has width of 200 characters.
I'll be very grateful indeed if someone can help me out of this particular problem...

Cheers, mates!

View 1 Replies View Related

How To Add A Missing Index To A Table In Merge Replication?

Jul 23, 2005

One of the table that is in a merge replication somehow is missing anindex. Strangely, only the table in one of the subscriber of the mergereplication is missing the index; another subscriber and the publisherof the merge replication don't have this problem.How should I add the missing index back to that table? My understandingis that making structural change on a table that is inmerge-replication is different from making change on a table that isnot merge-replicated. For example, when we need to add a column into atable that is being merge-replicated, we must add the column bychanging the attributes in the properties of the published article(table) instead of simply using CREATE INDEX command. I am wonderingwhether there is a similar restriction on adding an index onto a tablethat is merge replicated.I have already added the index back to the table anyway. I am askinghere just in case doing this may get me into a problem later on.Thanks in advance for any info.Jay Chan

View 3 Replies View Related

Transact SQL :: Missing Index Feature Disabled?

Apr 23, 2015

I have an exact copy of a database on 2 instances of SQL server (dev and test - dev is restored from test).There's a view that I select top 1000 rows from that runs extremely slow on both instances (DEV and TEST) however on DEV the execution plan specifies that I'm missing an index however in TEST the execution plan does not specify that I'm missing an index.

View 3 Replies View Related

Replication :: Subscriber Database Having Missing Index

Jul 22, 2015

At my subscriber database I found some missing Indexes if I update all the missing Indexes on subscriber DB, does it impact at on publisher side?

View 2 Replies View Related

SQL 2012 :: Execution Plan With Many Similar Missing Index Messages?

Oct 30, 2014

I'm in the process of trying to optimize a stored procedure with many queries. The execution plan provides a missing non-clustered index on nearly every query, and they're all fairly similar. The only real difference between them are what's in the INCLUDE statement. The two key columns are listed in every missing index. Let's say each query is approximately 5% of the total batch and 90% of the queries all fall into the category I listed above. How should I go about creating the missing indexes? Create all of the missing indexes or create one generic one that has all the INCLUDE columns? Create a minimal index with just a few of the common INCLUDE columns?

Here's an example of what I'm talking about with the missing indexes:

/*
USE [DB]
GO
CREATE NONCLUSTERED INDEX [<Name of Missing Index, sysname,>]
ON [dbo].[TABLE_1] ([COLUMN_A],[COLUMN_B])
INCLUDE ([C4ABCD],[C4ARTX],[C4ASTX],[C4ADNB],[C4AFNB],[C4BKVA])
GO
*/
/*

The Query Processor estimates that implementing the following index could improve the query cost by 99.9044%.

*/
/*
USE [DB]
GO
CREATE NONCLUSTERED INDEX [<Name of Missing Index, sysname,>]
ON [dbo].[TABLE_1] ([COLUMN_A],[COLUMN_B])
INCLUDE ([C4ARTX],[C4ASTX],[C4ADNB],[C4CZST])
GO
*/

/*

The Query Processor estimates that implementing the following index could improve the query cost by 99.5418%.

*/
/*
USE [DB]
GO
CREATE NONCLUSTERED INDEX [<Name of Missing Index, sysname,>]
ON [dbo].[TABLE_1] ([COLUMN_A],[COLUMN_B])
INCLUDE ([C4ABCD],[C4ARTX],[C4ASTX],[C4ADNB],[C4AFNB],[C4BKVA])
GO
*/

View 3 Replies View Related

Integration Services :: Cannot Load Counter Name Data Because Invalid Index Was Read From Registry

Aug 12, 2015

SSIS script task fail with error message-SSIS script task fail error message Error: Cannot load Counter Name data because an invalid index '' was read from the registry.

View 2 Replies View Related

Collect Missing Index Data Into Central Repository From Sys.dm_db_missing_index_group_stats, Groups, Details

Nov 2, 2007



Greetings:
I am trying to gather into a central location the missing index data from the sys DMV's for dynamic index creation in the next step. In trying to use a cursor, I get the following errors:

Msg 154, Level 15, State 3, Line 20

variable assignment is not allowed in a cursor declaration.

Msg 102, Level 15, State 1, Line 94

Incorrect syntax near 'Get_Data'.

Msg 16916, Level 16, State 1, Line 2

A cursor with the name 'Get_Server' does not exist.

Msg 16916, Level 16, State 1, Line 3

A cursor with the name 'Get_Server' does not exist.


Here is the SQL:


--CREATE PROCEDURE usp_Get_Missing_Index_Data

--AS

--Declare @Sql2 nvarchar(4000)

Declare @Sql nvarchar(4000)

DECLARE Get_Server Cursor -- gets a server name from a list of servers

for

Select MachineName from rsqlaudit1.DBStatistics.dbo.servers

Open Get_Server

Declare @Server nchar(20)

Fetch Next from Get_Server Into

@Server

While (@@FETCH_STATUS = 0) --and (@@FETCH_STATUS <> -2)

BEGIN



DECLARE Get_Data Cursor

FOR

select @sql= 'select distinct id.*

, gs.avg_total_user_cost

, gs.avg_user_impact

, gs.last_user_seek

,gs.unique_compiles

from '+@Server+'.master.sys.dm_db_missing_index_group_stats gs

,'+@Server+'.master.sys.dm_db_missing_index_groups g

,'+@Server+'.master.sys.dm_db_missing_index_details id

where gs.group_handle = g.index_group_handle

and id.index_handle = g.index_handle

order by gs.avg_user_impact desc'

exec (@Sql)



Open Get_Data

DECLARE @Handle int,

@database smallint,

@object int,

@equality nvarchar(4000),

@inequality nvarchar(4000),

@Included nvarchar(4000),

@statement nvarchar(4000),

@avg_user_cost float,

@avg_user_impact float,

@last_seek datetime,

@compiles bigint

Fetch NEXT FROM Get_Data INTO

@Handle,

@database,

@object,

@equality,

@inequality,

@Included,

@statement,

@avg_user_cost,

@avg_user_impact,

@last_seek,

@compiles

While (@@FETCH_STATUS = 0) --and (@@FETCH_STATUS <> -2)

BEGIN

insert into rsqlaudit1.DBStatistics.dbo.Missing_Index_data

values (@Server,

@Handle,

@database,

@object,

@equality,

@inequality,

@Included,

@statement,

@avg_user_cost,

@avg_user_impact,

@last_seek,

@compiles)

FETCH NEXT FROM Get_Data into

@Server,

@Handle,

@database,

@object,

@equality,

@inequality,

@Included,

@statement,

@avg_user_cost,

@avg_user_impact,

@last_seek,

@compiles

Fetch Next from Get_Server Into

@Server

END

CLOSE Get_Data

DEALLOCATE Get_Data

GO

CLOSE Get_Server

DEALLOCATE Get_Server

GO

Any suggestions are appreciated.

Thanks,
Derek

View 3 Replies View Related

Difference Between Index Seek &&amp; Index Scan &&amp; Index Lookup Operations?

Oct 20, 2006

please explain the differences btween this logical & phisicall operations that we can see therir graphical icons in execution plan tab in Management Studio

thank you in advance

View 3 Replies View Related

SQL 2012 :: Full Text Index How To Make It NOT To Index Embedded Or Attached Documents

Sep 30, 2015

I am using Full Text Index to index emails stored in BLOB column in a table. Index process parses stored emails, and, if there is one or more files attached to the email these documents get indexed too. In result when I'm querying the full text index for a word or phrase I am getting reference to the email containing the word of phrase if interest if the word was used in the email body OR if it was used in any document attached to the email.

How to distinguish in a Full Text query that the result came from an embedded document rather than from "main" document? Or if that's not possible how to disable indexing of embedded documents?

My goal is either to give a user an option if he or she wants to search emails (email bodies only) OR emails AND documents attached to them, or at least clearly indicate in the returned result the real source where the word or phrase has been found.

View 0 Replies View Related

Clustered Index On Client_ID+ORderNO+OrdersubNo, If I Create 3 Noncluster Index On Said Column Will It Imporve Performance

Dec 5, 2007



Dear All.

We had Teradata 4700 SMP. We have moved data from TD to MS_SQL SERVER 2003. records are 19.65 Millions.

table is >> Order_Dtl

Columns are:-

Client_ID varchar 10
Order_ID varchar 50
Order_Sub_ID decimal
.....
...
..
.
Pk is (ClientID+OrderId+OrderSubID)

Web Base application or PDA devices use to initiate the order from all over the country. The issue is this table is not Partioned but good HP with 30 GB RAM is installed. this is main table that receive 18,0000 hits or more. All brokers and users are using this table to see the status of their order.

The always search by OrderID, or ClientID or order_SubNo, or enter any two like (Client_ID+Order_Sub_ID) or any combination.

Query takes to much time when ever server receive more querys. some orther indexes are also created on the same table like (OrderDate, OrdCreate Date and Status)

My Question are:-


Q1. IF Person "A" query to DB on Client_ID, then what Index will use ? (If any one do Query on any two combination like Client_ID+Order_ID, So what index will be uesd.? How does MS-SQL SERVER deal with these kind of issues.?

Q2. If i create 3 more indexes on ClientID, ORderID and OrdersubID. will this improve the performance of query.if person "A" search record on orderNo so what index will be used. (Mind it their would be 3 seprate indexes for Each PK columns) and composite-Clustered index is also available.?

Q3. I want to check what indexes has been used? on what search?

Q4. How can i check what table was populated when, or last date of update (DML)?

My Limitation is i Dont Create a Partioned table. I dont have permission to do it.



In Teradata we had more than 4 tb record of CRM data with no issue. i am not new baby in db line but not expert in sql server 2003.


I am thank u to all who read or reply.

Arshad

Manager Database
Esoulconsultancy.com

(Teradata Master)
10g OCP










View 3 Replies View Related

Integration Services :: Rebuild Index / Refresh Index And Stats Improves Ssis Package Performance

Oct 28, 2015

My SSIS package is running very slow taking so much time to execute, One task is taking 2hr for inserting 100k records, i have disabled unused index still it is taking time.I am rebuilding/Refreshing indexes and stats once in month if i try to execute on daily basis will it improve my SSIS Package performance? 

View 2 Replies View Related

Index Was Out Of Range. Must Be Non-negative And Less Than The Size Of The Collection. Parameter Name: Index

Jan 22, 2006

Keep getting this error when positioning to the last page of a report.

Using Server 2003...SqlRpt Svcs 2000 sp2

Detail error msg:

Exception of type Microsoft.ReportingServices.ReportRendering.ReportRenderingException was thrown. (rrRenderingError) Get Online Help

Exception of type Microsoft.ReportingServices.ReportRendering.ReportRenderingException was thrown.

Index was out of range. Must be non-negative and less than the size of the collection. Parameter name: index

Anyone have any suggestions?  Any way to find out what collection is blowing?...or where parameter name: index comes from?

View 47 Replies View Related

Index Table1 And Select For 647.600 Records.. It Is So Slow.. But I Have No Index :)???

Jun 20, 2008

hello friends
i have table1 and 200 coulumn of table1 :) i have 647.600 records. i entered my records to table1 with for step to code lines in one day :)
i select category1 category2 and category3 with select code but i have just one index.. it is productnumber and it is primarykey..So my select code lines is so slow.. it is 7-9 second.. how can i select in 0.1 second ? Should i create index for category1 and category2 and category3 ? But i dont know create index.. My select code lines is below.. Could you learn me and show me index for it ?? or Could you learn me and show me fast Select code lines and index or etc ??? Also my search code line have a dangerous releated to attaching table1 with hackers :)
cheersi send 3 value of treview1 node and childnode and child.childnode to below page.aspx :)
Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load
If Not Me.IsPostBack Then
If Request("TextBox1") IsNot Nothing ThenTextBox1.Text = Request("TextBox1")
End If
If Request("TextBox2") IsNot Nothing ThenTextBox2.Text = Request("TextBox2")
End If
If Request("TextBox3") IsNot Nothing ThenTextBox3.Text = Request("TextBox3")
End If
End If
Dim searchword As String
If Request("TextBox3") = "" And Request("TextBox2") = "" Then
searchword = "Select * from urunlistesi where kategori= '" & Request("TextBox1") & "'"
End If
If Request("TextBox3") = "" Then
searchword = "Select * from urunlistesi where kategori= '" & Request("TextBox1") & "' and kategori1= '" & Request("TextBox2") & "'"
End If
If Request("TextBox3") <> "" And Request("TextBox2") <> "" And Request("TextBox1") <> "" Then
searchword = "Select * from urunlistesi where kategori= '" & Request("TextBox1") & "' and kategori1= '" & Request("TextBox2") & "' and kategori2= '" & Request("TextBox3") & "'"
End If
SqlDataSource1.SelectCommand = searchword
End Sub

View 11 Replies View Related

The Index Entry For Row ID Was Not Found In Index ID 3, Of Table 357576312

Jul 9, 2004

Hi,

I'm running a merge replication on a sql2k machine to 6 sql2k subscribers.
Since a few day's only one of the merge agents fail's with the following error:

The merge process could not retrieve generation information at the 'Subscriber'.
The index entry for row ID was not found in index ID 3, of table 357576312, in database 'PBB006'.

All DBCC CHECKDB command's return 0 errors :confused:
I'm not sure if the table that's referred to in the message is on the distribution side or the subscribers side? A select * from sysobjects where id=357576312 gives different results on both sides . .

Any ideas as to what is causing this error?

View 3 Replies View Related

Advantages Of Using Nonclustered Index After Using Clustered Index On One Table

Jul 3, 2006

Hi everyone,
When we create a clustered index firstly, and then is it advantageous to create another index which is nonclustered ??
In my opinion, yes it is. Because, since we use clustered index first, our rows are sorted and so while using nonclustered index on this data file, finding adress of the record on this sorted data is really easier than finding adress of the record on unsorted data, is not it ??

Thanks

View 4 Replies View Related

SQL 2012 :: Clustered Index Key Order In NC Index

Mar 5, 2015

I have a clustered index that consists of 3 int columns in this order: DateKey, LocationKey, ItemKey (there are many other columns in this data warehouse table such as quantities, prices, etc.).

Now I want to add a non-clustered index on just one of the other columns, say LocationKey, like this:
CREATE INDEX IX_test on TableName (LocationKey)

I understand that the clustered index keys will also be added as key columns to any NC indexes. So, in this case the NC index will also get the other two columns from the clustered index added as key columns. But, in what order will they be added?

Will the resulting index keys on this new NC index effectively be:

LocationKey, DateKey, ItemKey
OR
LocationKey, ItemKey, DateKey

Do the clustering keys get added to a NC index in the same order as they are defined in the clustered index?

View 1 Replies View Related

Clustered Index Vs. Full Text Index

Jun 18, 2008

Quick question about the primary purpose of Full Text Index vs. Clustered Index.

The Full Text Index has the purpose of being accessible outside of the database so users can query the tables and columns it needs while being linked to other databases and tables within the SQL Server instance.
Is the Full Text Index similar to the global variable in programming where the scope lies outside of the tables and database itself?

I understand the clustered index is created for each table and most likely accessed within the user schema who have access to the database.

Is this correct?

I am kind of confused on why you would use full text index as opposed to clustered index.

Thank you
Goldmember

View 2 Replies View Related

Index/performance Index For SELECT.... IN Statement

Sep 10, 2007



Hi All,

I 'm working to improve some sql performance.


One of the major syntax inside the SELECT statment is ..

WHERE FIELDA IN (SELECT PARAVALUE FROM PARATABLE WHERE SESSIONID = "XXXXX" AND PARATYPE='A') AND
WHERE FIELDB IN (SELECT PARAVALUE FROM PARATABLE WHERE SESSIONID = "XXXXX" AND PARATYPE='B') AND
WHERE FIELDC IN (SELECT PARAVALUE FROM PARATABLE WHERE SESSIONID = "XXXXX" AND PARATYPE='C') AND
WHERE FIELDD IN (SELECT PARAVALUE FROM PARATABLE WHERE SESSIONID = "XXXXX" AND PARATYPE='D') AND
WHERE FIELDE IN (SELECT PARAVALUE FROM PARATABLE WHERE SESSIONID = "XXXXX" AND PARATYPE='E') AND
WHERE FIELDF IN (SELECT PARAVALUE FROM PARATABLE WHERE SESSIONID = "XXXXX" AND PARATYPE='F')

(It's to compare the field content with some user input parameter inside a parameter table... )

I think properly is that the SELECT ... IN is causing much slowness in the sql statement. I have indexed FIELDA , FIELDB, FILEDC etc and those PARAVALUE and PARATYPE in the PARATABLE table. But perfromance is still slow and execution takes >20 seconds for 200000 rows of records.

Do any one know if still any chance to improvide the performance like this?

Much Thanks,

Andy

View 14 Replies View Related

Index Internals - Last Time Index Was Rebuilt?

Apr 17, 2007

I'm trying to find whether there is a dmv or system view that can help me see the last time an index was rebuilt or created. Assuming I rebuilt an index using tsql commands (not a job with a history), is there a way to find out the last time that index was rebuilt?



Thanks much.

View 6 Replies View Related

Index Scan Vs Index Seek

Mar 1, 2004

I have a really strange problem.

I execute this query:

declare @cid int
set @cid = 2003227

select * from sales s, product p where p.product_Id = s.product_Id and customer_id = @cid

select * from sales s, product p where p.product_Id = s.product_Id and customer_id = @cid or @cid = 0

3 Million rows in sales, 120000 in product.

The first does and index seek, the second an index scan.
The execution plan reports that the scan takes 99.87% of the cost, and the seek takes 0.13%

This problem obviously gets worse the bigger the dataset / query /etc.

The reason I query this, is because it never used to take this long to do index scans. Is there something i can change, something i can fix?

Any help would be appreciated.

Josh

View 2 Replies View Related

Reorganize Index And Rebuild Index ??

Mar 18, 2008

Hi,

I just want to know whether any advantage or disadvantage
in doing Reorganize Index And Rebuild Index ....

Plz do comment on this ASAP !!!!

Thanks in advance

Regards

Arv

View 1 Replies View Related

Reorganize Index And Rebuild Index

Mar 18, 2008

Hi,

I just want to know whether any advantage or disadvantage
in doing Reorganize Index And Rebuild Index ....

Plz do comment on this ASAP !!!!

Thanks in advance

Regards

Arv

View 6 Replies View Related

Clustered Index Or NonClustered Index

Apr 1, 2006

Hello I want to learn disparity clustered index or nonclustered index and in queries which one run better.

example

select * from orders where orderID=5

to this query clustered or nonclustered

thanks



View 3 Replies View Related

Simple Query Chooses Clustered Index Scan Instead Of Clustered Index Seek

Nov 14, 2006

the query:

SELECT a.AssetGuid, a.Name, a.LocationGuid
FROM Asset a WHERE a.AssociationGuid IN (
SELECT ada.DataAssociationGuid FROM AssociationDataAssociation ada
WHERE ada.AssociationGuid = '568B40AD-5133-4237-9F3C-F8EA9D472662')

takes 30-60 seconds to run on my machine, due to a clustered index scan on our an index on asset [about half a million rows].  For this particular association less than 50 rows are returned. 

expanding the inner select into a list of guids the query runs instantly:

SELECT a.AssetGuid, a.Name, a.LocationGuid
FROM Asset a WHERE a.AssociationGuid IN (
'0F9C1654-9FAC-45FC-9997-5EBDAD21A4B4',
'52C616C0-C4C5-45F4-B691-7FA83462CA34',
'C95A6669-D6D1-460A-BC2F-C0F6756A234D')

It runs instantly because of doing a clustered index seek [on the same index as the previous query] instead of a scan.  The index in question IX_Asset_AssociationGuid is a nonclustered index on Asset.AssociationGuid.

The tables involved:

Asset, represents an asset.  Primary key is AssetGuid, there is an index/FK on Asset.AssociationGuid.  The asset table has 28 columns or so...
Association, kind of like a place, associations exist in a tree where one association can contain any number of child associations.  Each association has a ParentAssociationGuid pointing to its parent.  Only leaf associations contain assets. 
AssociationDataAssociation, a table consisting of two columns, AssociationGuid, DataAssociationGuid.  This is a table used to quickly find leaf associations [DataAssociationGuid] beneath a particular association [AssociationGuid].  In the above case the inner select () returns 3 rows. 

I'd include .sqlplan files or screenshots, but I don't see a way to attach them. 

I understand I can specify to use the index manually [and this also runs instantly], but for such a simple query it is peculiar it is necesscary.  This is the query with the index specified manually:

SELECT a.AssetGuid, a.Name, a.LocationGuid
FROM Asset a WITH (INDEX (IX_Asset_AssociationGuid)) WHERE
a.AssociationGuid IN (
SELECT ada.DataAssociationGuid FROM AssociationDataAssociation ada
WHERE ada.AssociationGuid = '568B40AD-5133-4237-9F3C-F8EA9D472662')

To repeat/clarify my question, why might this not be doing a clustered index seek with the first query?

View 15 Replies View Related

Change Nc-index To C-index?

Jun 29, 2004

Found out a while back that my facts-tabel has an non-clustered index on its facts_id. In a bunch of procedures an update is executed against a facts_id unfortunately on it's facts-table. I was wondering if changing it into a clustered index is worth the effort / would make sense considering a +110 million facts and re-indexing the other indexes as well? Facts are loaded sequentially, so I would suspect them facts are in the ordered already?

thanx,

View 3 Replies View Related







Copyrights 2005-15 www.BigResource.com, All rights reserved