RobHVB6Sql
Programmer
I am recieving timeouts here and I cant work out why.
Only retrieving on a table.
1) Table Creation script:
2) The table has now been filled with 38996 rows and I have created two indexes.
PS: exec sp_helpindex 'tblIdentityMapping_Person'
--returns the following
index_name index_description index_keys
--------------------------------- ------------------------------- -------------
tblIdentityMapping_PersonPrimIdx clustered located on PRIMARY FromID
tblIdentityMapping_PersonAltIdx nonclustered located on PRIMARY ToID
3) The query that is giving timeouts:
4) NB: This is running through VB 6 and an ADO recordset.
Can I make this any more efficient, it times out after 120 seconds!
Rob Hasard
Data Manager -Genetic Services
(VB6 /SQL 7.0)
Only retrieving on a table.
1) Table Creation script:
Code:
if exists (select * from sysobjects where id = object_id('tblIdentityMapping_Person') and sysstat & 0xf = 3)
drop table tblIdentityMapping_Person
GO
CREATE TABLE tblIdentityMapping_Person (
FromID INT NOT NULL,
ToID INT NOT NULL
)
GO
Code:
CREATE CLUSTERED INDEX tblIdentityMapping_PersonPrimIdx ON tblIdentityMapping_Person(FromID)
CREATE INDEX tblIdentityMapping_PersonAltIdx ON tblIdentityMapping_Person(ToID)
GO
UPDATE STATISTICS tblIdentityMapping_Person
GO
PS: exec sp_helpindex 'tblIdentityMapping_Person'
--returns the following
index_name index_description index_keys
--------------------------------- ------------------------------- -------------
tblIdentityMapping_PersonPrimIdx clustered located on PRIMARY FromID
tblIdentityMapping_PersonAltIdx nonclustered located on PRIMARY ToID
3) The query that is giving timeouts:
Code:
SELECT ToID FROM tblIdentityMapping_Person WHERE FromID = 10498
4) NB: This is running through VB 6 and an ADO recordset.
Can I make this any more efficient, it times out after 120 seconds!
Rob Hasard
Data Manager -Genetic Services
(VB6 /SQL 7.0)