Problem: the problem is: Table A140 contains 350 million pieces of data, and table B temporary table contains pieces of data. Now I use such a query statement: select * fromAwhereexists (select1fromBwhereB. batchnoA. batchno) Table A and table B are associated by the batchno field. The field type is varchar (50). In table A, the batchno creates an index database.
Problem: the problem is: Table A has 1.4 million data records, and table B has 350 temporary data records. Now I use this query statement, select * from A where exists (select 1 from B where B. batchno =. batchno) Table A and table B are associated by the batchno field. The field type is varchar (50). In table A, the batchno creates an index database.
Problem:
The problem is: Table A contains 1.4 millionData, Table B temporary table 350Data,
I am using thisQueryStatement, select * from A where exists (select 1 from B where B. batchno = A. batchno)
Table A and table B are associated with the batchno field. The field type is varchar (50). The batchno field in Table A is indexed.
DataThe database is SQL server 2000,QueryIs there any way to optimize the time between 23 and 30?
Solution:
Do not connect two tables
First, set batchno in Table B
Use select batchno from B
Detected
String (batchno1, batchno2, batchno3, bat4 ,......)
Then select * from A where batchno int (batchno1, batchno2, batchno3, batc4 ,......)
I recently worked on a project to process millions of log records.QueryHalf a day
Later, we split the tables one by one and checked the restrictions.ConditionSave it first.
Original address: http://topic.csdn.net/u/20090523/16/9e891fda-72dc-4417-b554-22edfde7e437.html? 52778