Skip to content

Instantly share code, notes, and snippets.

View shiguruikai's full-sized avatar

shiguruikai shiguruikai

View GitHub Profile
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

SQL Serverでテーブルの結合順序を制御する4つの方法

結論

  • 最も推奨される方法は、統計情報の適切な管理と最適化です。⇒ 「インデックス再構築」および「統計情報の更新」
  • 特定のシナリオでテーブルの結合順序を制御する必要がある場合は、適切な方法を選択し、将来の変更にも対応できるように注意することが重要です。
  • TOP句は、特定のテーブルの結合順序の制御に適しています。
  • FORCE ORDERクエリヒントや結合ヒント(HASH, MERGE, LOOP)は、結合順序を確実に制御できますが、ヒントを使用することでクエリの計画が固定されるため、将来的なデータの変更により、クエリの効率性が低下する可能性があるので注意が必要です。

1. 統計情報の最適化

@shiguruikai
shiguruikai / _flex-layout.scss
Created July 24, 2023 05:10
Angular Flex-Layout の代替(すべてを網羅しているわけではありません)
// Angular Flex-Layout の代替
[fxLayout] {
box-sizing: border-box;
display: flex;
}
[fxLayout^='row'] {
flex-direction: row;
}
@shiguruikai
shiguruikai / Create-Dataset.ps1
Last active December 9, 2023 00:16
rvcやsvc用の学習データを作成するためのスクリプト。
# Requires -Version 7.1
[CmdletBinding()]
param (
[Parameter(Mandatory)]
[string]
$SrcDir,
[Parameter(Mandatory)]
[string]
@shiguruikai
shiguruikai / Get-Chunk.ps1
Created April 12, 2023 12:27
PowerShellでwindowed関数的なやつ。
[OutputType("System.Array")]
[CmdletBinding()]
param (
[Parameter(Mandatory, ValueFromPipeline)]
[psobject]$InputObject,
[Parameter(Mandatory, Position = 0)]
[int]$Size,
[Parameter()]
@shiguruikai
shiguruikai / CountLines.java
Created January 15, 2023 14:26
Quickly count lines in large files. 大きなファイルの行数を素早く数える。
import java.nio.ByteBuffer;
import java.nio.file.Files;
import java.nio.file.Paths;
import java.nio.file.StandardOpenOption;
public class CountLines {
private static final int MAX_BUFFER_SIZE = 1024 * 1024;
public static void main(String[] args) throws Exception {
if (args.length < 1) {
@shiguruikai
shiguruikai / uBlacklist.txt
Last active May 27, 2022 08:07
uBlacklistのブラックリスト(自分用)
*://udemy.benesse.co.jp/*
*://www.udemy.com/*
*://www.sejuku.net/*
*://www.pasonatech.co.jp/*
*://tech-camp.in/*
*://career.levtech.jp/*
*://techacademy.jp/*
@shiguruikai
shiguruikai / Microsoft.PowerShell_profile.ps1
Last active March 21, 2023 23:16
自分用のPowerShellプロファイル
# beep音を無効化
Set-PSReadlineOption -BellStyle None
function TextEncodingsArgumentCompleter {
[OutputType([System.Management.Automation.CompletionResult])]
param(
[string] $CommandName,
[string] $ParameterName,
[string] $WordToComplete,
[System.Management.Automation.Language.CommandAst] $CommandAst,
@shiguruikai
shiguruikai / ZipUtils.java
Last active February 28, 2022 13:56
JavaでZIPを圧縮・展開するユーティリティクラス。
import static java.nio.file.StandardCopyOption.REPLACE_EXISTING;
import static java.nio.file.StandardOpenOption.CREATE;
import static java.nio.file.StandardOpenOption.CREATE_NEW;
import static java.nio.file.StandardOpenOption.TRUNCATE_EXISTING;
import static java.nio.file.StandardOpenOption.WRITE;
import java.io.File;
import java.io.IOException;
import java.io.InputStream;
import java.io.OutputStream;
function Sort-Naturally {
[CmdletBinding()]
param (
[Parameter(
ValueFromPipeline = $true)]
[object]
$InputObject,
[Parameter(
Position = 0)]