From c7e613b27d680eb545ec38a2ea75b24e1693c823 Mon Sep 17 00:00:00 2001 From: Lilian Lee Date: Thu, 13 Feb 2025 15:39:44 +0800 Subject: [PATCH 1/3] Add temp.md --- temp.md | 1 + 1 file changed, 1 insertion(+) create mode 100644 temp.md diff --git a/temp.md b/temp.md new file mode 100644 index 000000000000..af27ff4986a7 --- /dev/null +++ b/temp.md @@ -0,0 +1 @@ +This is a test file. \ No newline at end of file From 3e6850f159df114efad5335c41c3adc84452c6c2 Mon Sep 17 00:00:00 2001 From: Lilian Lee Date: Thu, 13 Feb 2025 15:39:49 +0800 Subject: [PATCH 2/3] Delete temp.md --- temp.md | 1 - 1 file changed, 1 deletion(-) delete mode 100644 temp.md diff --git a/temp.md b/temp.md deleted file mode 100644 index af27ff4986a7..000000000000 --- a/temp.md +++ /dev/null @@ -1 +0,0 @@ -This is a test file. \ No newline at end of file From 59e2833482e289db2dca21a9b3cdbae3901cde16 Mon Sep 17 00:00:00 2001 From: lilin90 Date: Thu, 13 Feb 2025 15:43:00 +0800 Subject: [PATCH 3/3] Update subquery-optimization.md --- subquery-optimization.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/subquery-optimization.md b/subquery-optimization.md index ede0fa35f71f..cd3bf0c698bf 100644 --- a/subquery-optimization.md +++ b/subquery-optimization.md @@ -24,7 +24,7 @@ summary: 了解子查询相关的优化。 对于这种情况,可以将 `ALL` 或者 `ANY` 用 `MAX` 以及 `MIN` 来代替。不过由于在表为空时,`MAX(EXPR)` 以及 `MIN(EXPR)` 的结果会为 `NULL`,其表现形式和 `EXPR` 是有 `NULL` 值的结果一样。以及外部表达式结果为 `NULL` 时也会影响表达式的最终结果,因此这里完整的改写会是如下的形式: - `t.id < all(select s.id from s)` 会被改写为 `t.id < min(s.id) and if(sum(s.id is null) != 0, null, true)`。 -- `t.id < any (select s.id from s)` 会被改写为 `t.id < max(s.id) or if(sum(s.id is null) != 0, null, false)`。 +- `t.id > any (select s.id from s)` 会被改写为 `t.id > max(s.id) or if(sum(s.id is null) != 0, null, false)`。 ## `... != ANY (SELECT ... FROM ...)`