From 3096dcf48a94d61df64bdedca080e5a6117b9c36 Mon Sep 17 00:00:00 2001 From: dldusgh318 Date: Sat, 15 Nov 2025 23:56:22 +0900 Subject: [PATCH 1/3] =?UTF-8?q?7=EC=A3=BC=EC=B0=A8=20=EA=B3=BC=EC=A0=9C?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- INDEX.md | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/INDEX.md b/INDEX.md index 78061e8..0407d66 100644 --- a/INDEX.md +++ b/INDEX.md @@ -121,4 +121,5 @@ ON schedule (movie_id, theater_id, start_time); ![image.png](attachment:f9bb6e9a-7421-4716-a6c5-d5ce0ede626a:image.png) -duration은 0.0020 → 0.0012, fetch는 0.000016 → 0.000012로 줄어든 걸 확인할 수 있다 \ No newline at end of file +duration은 0.0020 → 0.0012, fetch는 0.000016 → 0.000012로 줄어든 걸 확인할 수 있다! + From 3468156595dbd9c6cd5f9b63d43f1b6840fad26e Mon Sep 17 00:00:00 2001 From: dldusgh318 Date: Mon, 17 Nov 2025 16:06:52 +0900 Subject: [PATCH 2/3] =?UTF-8?q?7=EC=A3=BC=EC=B0=A8=20=EA=B3=BC=EC=A0=9C=20?= =?UTF-8?q?-=20=EC=82=AC=EC=A7=84=20=EC=98=A4=EB=A5=98=20=EC=88=98?= =?UTF-8?q?=EC=A0=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- INDEX.md | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/INDEX.md b/INDEX.md index 0407d66..7ea8a53 100644 --- a/INDEX.md +++ b/INDEX.md @@ -63,7 +63,7 @@ ON movie (age_rating, movie_id, genre); 인덱스 사용 전 후 비교 -![image.png](attachment:f2fe2ebd-d508-4d26-ad10-6028d71b67b6:image.png) +스크린샷 2025-11-15 오전 2 42 53 실행 전에는 Durationn이 0.00079sec, fetch가 0.000016 sec이었다. @@ -75,7 +75,7 @@ ON movie (age_rating, movie_id, genre); 그렇다면 인덱스는 데이터가 수천~수만 건일 때 효율적이라는 걸 확인 -![image.png](attachment:be16d42e-4a69-48aa-8e92-e66f7cfda108:image.png) +스크린샷 2025-11-15 오전 2 39 56 실제로 데이터를 1200건 넣었고, 데이터가 많을 때는 인덱스가 효과적이라는 사실을 알 수 있었다 @@ -85,11 +85,11 @@ ON movie (age_rating, movie_id, genre); select movie_id, genre from movie where age_rating = 'ALL' GROUP BY movie_id, genre; ``` -![image.png](attachment:df54f3b9-8185-425c-ad84-4e21b488e8aa:image.png) +image explain으로 확인한 결과 커버링 인덱스 사용하는 거 확인 -![image.png](attachment:96ebb339-c0da-4e71-bde9-c85f322879cf:image.png) +image duration이 0.0010 → 0.00089, fetch가 0.000015 → 0.000014로 줄어든 걸 확인할 수 있었다. @@ -119,7 +119,10 @@ CREATE INDEX idx_schedule_movie_theater_start ON schedule (movie_id, theater_id, start_time); ``` -![image.png](attachment:f9bb6e9a-7421-4716-a6c5-d5ce0ede626a:image.png) +image + + +image duration은 0.0020 → 0.0012, fetch는 0.000016 → 0.000012로 줄어든 걸 확인할 수 있다! From 70c64d2c7b2c736f3ea0bd01e1505707740ca089 Mon Sep 17 00:00:00 2001 From: dldusgh318 Date: Mon, 17 Nov 2025 17:54:51 +0900 Subject: [PATCH 3/3] =?UTF-8?q?7=EC=A3=BC=EC=B0=A8=20=EA=B3=BC=EC=A0=9C=20?= =?UTF-8?q?-=20=EC=82=AC=EC=A7=84=20=EC=98=A4=EB=A5=98=20=EC=88=98?= =?UTF-8?q?=EC=A0=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- TRANSACTION.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/TRANSACTION.md b/TRANSACTION.md index 1d0a9bb..0816a51 100644 --- a/TRANSACTION.md +++ b/TRANSACTION.md @@ -12,7 +12,7 @@ - NEVER - NESTED -![image.png](attachment:c2f0b822-2c0e-4b20-857a-1324e67944ff:image.png) +image 개인적으로 둘의 차이를 정리해보고 싶어 표로 정리했다.