l******9 发帖数: 579 | 1 I am comparing two tables to make sure they are same row by row and column
by column on SQL server.
SELECT *
FROM t1, t2
WHERE t1.column1 = t2.column1 AND t1.column2 = t2.column2
AND t1.column3 = t2.column3 AND t1.column4 != t2.column4
The tables are vey large, more than 100 million.
I got error:
ERROR [HY000] ERROR: 9434 : Not enough memory for merge-style join
Are there better ways to do this comparison.
thanks ! | l*********8 发帖数: 4642 | 2 CREATE UNIQUE INDEX
ON t1(column1, column2, column3);
CREATE UNIQUE INDEX
ON t2(column1, column2, column3);
SELECT 'different'
FROM dual
WHERE EXIST
(
SELECT *
FROM t1, t2
WHERE t1.column1 = t2.column1 AND t1.column2 = t2.column2
AND t1.column3 = t2.column3 AND t1.column4 != t2.column4
);
【在 l******9 的大作中提到】 : I am comparing two tables to make sure they are same row by row and column : by column on SQL server. : SELECT * : FROM t1, t2 : WHERE t1.column1 = t2.column1 AND t1.column2 = t2.column2 : AND t1.column3 = t2.column3 AND t1.column4 != t2.column4 : The tables are vey large, more than 100 million. : I got error: : ERROR [HY000] ERROR: 9434 : Not enough memory for merge-style join : Are there better ways to do this comparison.
| l******9 发帖数: 579 | 3 i got error:
CREATE UNIQUE INDEX Pindex1
ON t1 (column1, column2, column3);
ERROR [HY000] ERROR: CREATE INDEX not supported in this release
Thanks
【在 l*********8 的大作中提到】 : CREATE UNIQUE INDEX : ON t1(column1, column2, column3); : CREATE UNIQUE INDEX : ON t2(column1, column2, column3); : SELECT 'different' : FROM dual : WHERE EXIST : ( : SELECT * : FROM t1, t2
| l*********8 发帖数: 4642 | 4 不让建索引太奇怪了。
看了一下, 你这个好像是IBM一个系统里的SQL。 不知道有哪些限制。
【在 l******9 的大作中提到】 : i got error: : CREATE UNIQUE INDEX Pindex1 : ON t1 (column1, column2, column3); : ERROR [HY000] ERROR: CREATE INDEX not supported in this release : Thanks
|
|