50 lines
3.4 KiB
XML
50 lines
3.4 KiB
XML
<?xml version="1.0" encoding="UTF-8"?>
|
|
<svg xmlns="http://www.w3.org/2000/svg" width="720" height="300" viewBox="0 0 720 300" role="img" aria-labelledby="diagram-title diagram-description">
|
|
<title id="diagram-title">그룹당 상위 몇 개를 만드는 세 방식은 읽는 범위가 다르다</title>
|
|
<desc id="diagram-description">세 방식 모두 부모마다 상위 몇 개씩 같은 결과를 만든다. 윈도우 함수는 파티션 전체를 읽어 순번을 매긴 뒤 상위만 남긴다. LATERAL은 부모마다 정렬 인덱스에서 필요한 개수만 읽고 멈춘다. 애플리케이션 그룹핑은 자식 전량을 애플리케이션으로 보낸 뒤 코드에서 자른다. 읽는 범위가 다르므로 읽은 블록 수도 갈린다. 그룹이 크고 필요한 개수가 작을수록 LATERAL이 읽지 않는 범위가 넓어진다.</desc>
|
|
<defs>
|
|
<marker id="arrow" viewBox="0 0 10 10" refX="9" refY="5" markerWidth="7" markerHeight="7" orient="auto-start-reverse">
|
|
<path d="M 0 0 L 10 5 L 0 10 z" />
|
|
</marker>
|
|
<pattern id="hatch" width="7" height="7" patternTransform="rotate(45)" patternUnits="userSpaceOnUse">
|
|
<line x1="0" y1="0" x2="0" y2="7" stroke="#9ca3af" stroke-width="3" />
|
|
</pattern>
|
|
<style>
|
|
:root { color-scheme: light; }
|
|
text { font-family: Inter, Pretendard, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif; fill: #111827; }
|
|
.canvas { fill: #ffffff; }
|
|
.group-box { fill: #ffffff; stroke: #9ca3af; stroke-width: 1.4; stroke-dasharray: 7 5; }
|
|
.group-label-bg { fill: #ffffff; }
|
|
.group-label { font-size: 13px; font-weight: 650; fill: #374151; }
|
|
.edge { fill: none; stroke: #374151; stroke-width: 1.8; stroke-linejoin: round; stroke-linecap: round; marker-end: url(#arrow); }
|
|
.edge.dashed { stroke-dasharray: 7 5; }
|
|
.edge.primary { stroke: #2563eb; stroke-width: 2.2; }
|
|
.edge.muted { stroke: #9ca3af; }
|
|
.node { fill: #ffffff; stroke: #4b5563; stroke-width: 1.7; }
|
|
.node.primary { stroke: #2563eb; stroke-width: 2.4; }
|
|
.node.muted { stroke: #9ca3af; fill: #f9fafb; }
|
|
.node.marked { stroke: #4b5563; stroke-width: 2.4; stroke-dasharray: 5 4; }
|
|
.label { font-size: 14px; font-weight: 650; text-anchor: middle; }
|
|
.fill-kept { fill: #2563eb; stroke: none; }
|
|
.fill-drop { fill: url(#hatch); stroke: #9ca3af; stroke-width: 1; }
|
|
.fill-none { fill: #ffffff; stroke: #d1d5db; stroke-width: 1; }
|
|
</style>
|
|
</defs>
|
|
<rect class="canvas" width="720" height="300" />
|
|
<rect class="node " x="40" y="56" width="190" height="62" rx="7" />
|
|
<text class="label" x="135.0" y="92.0">윈도우 함수</text>
|
|
<rect class="node " x="330" y="56" width="350" height="62" rx="7" />
|
|
<text class="label" x="505.0" y="92.0">파티션 전체</text>
|
|
<polyline class="edge " points="230,87 330,87" />
|
|
<rect class="node primary" x="40" y="146" width="190" height="62" rx="7" />
|
|
<text class="label" x="135.0" y="182.0">LATERAL</text>
|
|
<rect class="node primary" x="330" y="146" width="350" height="62" rx="7" />
|
|
<text class="label" x="505.0" y="182.0">부모별 인덱스 seek</text>
|
|
<polyline class="edge primary" points="230,177 330,177" />
|
|
<rect class="node " x="40" y="236" width="190" height="62" rx="7" />
|
|
<text class="label" x="135.0" y="272.0">애플리케이션 그룹핑</text>
|
|
<rect class="node muted" x="330" y="236" width="350" height="62" rx="7" />
|
|
<text class="label" x="505.0" y="272.0">자식 전량</text>
|
|
<polyline class="edge " points="230,267 330,267" />
|
|
</svg>
|