FIX: SQL Server CE Delete Query with a Subquery Over a Large Table Might Stop Responding (Hang) (303004)
The information in this article applies to:
- Microsoft SQL Server 2000 Windows CE Edition
- Microsoft SQL Server 2000 Windows CE Edition 1.1
This article was previously published under Q303004 BUG # 2760 (SSCE)
SYMPTOMS A Microsoft SQL Server 2000 Windows CE Edition (SQL Server
CE) Delete query, with a subquery over a large table, might appear to stop
responding (hang). For example, a query similar to the following might take a
long time to return if the tables t1 and t2 are large: delete from t1 where col1 in (select t2.col1 from t2 where t2.col2="something") Creating indexes on the relevant columns of the tables might not solve
the problem for this particular query. CAUSE SQL Server CE does not optimize delete queries to use
indexes. This causes SQL Server CE to perform a file scan of a really big table
in this scenario. RESOLUTIONTo resolve this problem, install Microsoft SQL Server 2000
Windows CE 2.0.
SQL Server CE 2.0 adds optimization for Delete and
Update queries to use indexes. The workaround described in this article might
still be useful for complex queries on large databases that use SQL Server CE
2.0.WORKAROUNDTo work around this problem you can either:
- Use a cascading delete.
- Manually build the subquery results.
- Use two recordsets and a Seek.
- Upgrade to a device with more memory.
- Write the application by using the OLE DB API.
For more information about these workarounds, see the "More
Information" section. STATUS Microsoft
has confirmed that this is a problem in the Microsoft products that are listed
at the beginning of this article.
This problem was first corrected in Microsoft SQL Server 2000 Windows CE Edition
Service Pack 2.0.REFERENCESFor more information about the latest version of SQL Server
CE, visit the following Microsoft Web site: SQL Server 2000 Books Online; topics: "CREATE TABLE"; "ALTER
TABLE"
Modification Type: | Minor | Last Reviewed: | 8/25/2005 |
---|
Keywords: | kbprb KB303004 kbAudDeveloper |
---|
|