LucieLastic
Programmer
hi All
I'm trying my best to speed up a simple select statement.
The select is a basic SELECT * from TABLE WHERE ID = n. The ID is indexed on the table.
I then tried sticking it in a Temp table
SELECT *
INTO #TempTable
from TABLE WHERE ID = n
I'm sticking the sql statement in a TQuery.SQL property and then doing an EXECSQL on the query, but it takes ages (15 secs).
The DB is SYBASE and the the table I'm querying has approx 600,000 records. The result set is about 166 records.
I've also tried to create a View, but the reading of the view is much slower than reading the Temp table.
Performing the SQL statements in SQLExplorer is quick but calling the EXECSQL is slow, is there anyway of speeding this up? StoredProcs are out really as it's the client db and they don't want me creating them all over the place - I have to make sure I clean up anything I create.
Any suggestions ?
many thanks
lou
I'm trying my best to speed up a simple select statement.
The select is a basic SELECT * from TABLE WHERE ID = n. The ID is indexed on the table.
I then tried sticking it in a Temp table
SELECT *
INTO #TempTable
from TABLE WHERE ID = n
I'm sticking the sql statement in a TQuery.SQL property and then doing an EXECSQL on the query, but it takes ages (15 secs).
The DB is SYBASE and the the table I'm querying has approx 600,000 records. The result set is about 166 records.
I've also tried to create a View, but the reading of the view is much slower than reading the Temp table.
Performing the SQL statements in SQLExplorer is quick but calling the EXECSQL is slow, is there anyway of speeding this up? StoredProcs are out really as it's the client db and they don't want me creating them all over the place - I have to make sure I clean up anything I create.
Any suggestions ?
many thanks
lou