;WITH MyDuplicate AS (SELECT
Sch.[name] AS SchemaName,
Obj.[name] AS TableName,
Idx.[name] AS IndexName,
INDEX_COL(Sch.[name] + '.' + Obj.[name], Idx.index_id, 1) AS Col1,
INDEX_COL(Sch.[name] + '.' + Obj.[name], Idx.index_id, 2) AS Col2,
INDEX_COL(Sch.[name] + '.' + Obj.[name], Idx.index_id, 3) AS Col3,
INDEX_COL(Sch.[name] + '.' + Obj.[name], Idx.index_id, 4) AS Col4,
INDEX_COL(Sch.[name] + '.' + Obj.[name], Idx.index_id, 5) AS Col5,
INDEX_COL(Sch.[name] + '.' + Obj.[name], Idx.index_id, 6) AS Col6,
INDEX_COL(Sch.[name] + '.' + Obj.[name], Idx.index_id, 7) AS Col7,
INDEX_COL(Sch.[name] + '.' + Obj.[name], Idx.index_id, 8) AS Col8,
INDEX_COL(Sch.[name] + '.' + Obj.[name], Idx.index_id, 9) AS Col9,
INDEX_COL(Sch.[name] + '.' + Obj.[name], Idx.index_id, 10) AS Col10,
INDEX_COL(Sch.[name] + '.' + Obj.[name], Idx.index_id, 11) AS Col11,
INDEX_COL(Sch.[name] + '.' + Obj.[name], Idx.index_id, 12) AS Col12,
INDEX_COL(Sch.[name] + '.' + Obj.[name], Idx.index_id, 13) AS Col13,
INDEX_COL(Sch.[name] + '.' + Obj.[name], Idx.index_id, 14) AS Col14,
INDEX_COL(Sch.[name] + '.' + Obj.[name], Idx.index_id, 15) AS Col15,
INDEX_COL(Sch.[name] + '.' + Obj.[name], Idx.index_id, 16) AS Col16
FROM sys.indexes Idx
INNER JOIN sys.objects Obj ON Idx.[object_id] = Obj.[object_id] INNER JOIN sys.schemas Sch ON Sch.[schema_id] = Obj.[schema_id] WHERE index_id > 0)
SELECT    MD1.SchemaName, MD1.TableName, MD1.IndexName,
MD2.IndexName AS OverLappingIndex,
MD1.Col1, MD1.Col2, MD1.Col3, MD1.Col4,
MD1.Col5, MD1.Col6, MD1.Col7, MD1.Col8,
MD1.Col9, MD1.Col10, MD1.Col11, MD1.Col12,
MD1.Col13, MD1.Col14, MD1.Col15, MD1.Col16
FROM MyDuplicate MD1
INNER JOIN MyDuplicate MD2 ON MD1.tablename = MD2.tablename
AND MD1.indexname <> MD2.indexname
AND MD1.Col1 = MD2.Col1
AND (MD1.Col2 IS NULL OR MD2.Col2 IS NULL OR MD1.Col2 = MD2.Col2)
AND (MD1.Col3 IS NULL OR MD2.Col3 IS NULL OR MD1.Col3 = MD2.Col3)
AND (MD1.Col4 IS NULL OR MD2.Col4 IS NULL OR MD1.Col4 = MD2.Col4)
AND (MD1.Col5 IS NULL OR MD2.Col5 IS NULL OR MD1.Col5 = MD2.Col5)
AND (MD1.Col6 IS NULL OR MD2.Col6 IS NULL OR MD1.Col6 = MD2.Col6)
AND (MD1.Col7 IS NULL OR MD2.Col7 IS NULL OR MD1.Col7 = MD2.Col7)
AND (MD1.Col8 IS NULL OR MD2.Col8 IS NULL OR MD1.Col8 = MD2.Col8)
AND (MD1.Col9 IS NULL OR MD2.Col9 IS NULL OR MD1.Col9 = MD2.Col9)
AND (MD1.Col10 IS NULL OR MD2.Col10 IS NULL OR MD1.Col10 = MD2.Col10)
AND (MD1.Col11 IS NULL OR MD2.Col11 IS NULL OR MD1.Col11 = MD2.Col11)
AND (MD1.Col12 IS NULL OR MD2.Col12 IS NULL OR MD1.Col12 = MD2.Col12)
AND (MD1.Col13 IS NULL OR MD2.Col13 IS NULL OR MD1.Col13 = MD2.Col13)
AND (MD1.Col14 IS NULL OR MD2.Col14 IS NULL OR MD1.Col14 = MD2.Col14)
AND (MD1.Col15 IS NULL OR MD2.Col15 IS NULL OR MD1.Col15 = MD2.Col15)
AND (MD1.Col16 IS NULL OR MD2.Col16 IS NULL OR MD1.Col16 = MD2.Col16)
ORDER BY MD1.SchemaName,MD1.TableName,MD1.IndexName

참고자료

https://blog.sqlauthority.com/2011/07/13/sql-server-query-to-find-duplicate-indexes-script-to-find-redundant-indexes/

 

SQL SERVER - Query to Find Duplicate Indexes - Script to Find Redundant Indexes - SQL Authority with Pinal Dave

I was recently delivering session on Performance Tuning subject. I was asking if there is any harm having duplicate indexes. Of course, duplicate indexes

blog.sqlauthority.com

-- 모든 config 값 조회
-- 아래 리스트의 실제 설정 값은 생략하였고, 4.0.11 기준
127.0.0.1:6379> config get *
  1) "dbfilename"
  3) "requirepass"
  5) "masterauth"
  7) "cluster-announce-ip"
  9) "unixsocket"
 11) "logfile"
 13) "pidfile"
 15) "slave-announce-ip"
 17) "maxmemory"
 19) "proto-max-bulk-len"
 21) "client-query-buffer-limit"
 23) "maxmemory-samples"
 25) "lfu-log-factor"
 27) "lfu-decay-time"
 29) "timeout"
 31) "active-defrag-threshold-lower"
 33) "active-defrag-threshold-upper"
 35) "active-defrag-ignore-bytes"
 37) "active-defrag-cycle-min"
 39) "active-defrag-cycle-max"
 41) "auto-aof-rewrite-percentage"
 43) "auto-aof-rewrite-min-size"
 45) "hash-max-ziplist-entries"
 47) "hash-max-ziplist-value"
 49) "list-max-ziplist-size"
 51) "list-compress-depth"
 53) "set-max-intset-entries"
 55) "zset-max-ziplist-entries"
 57) "zset-max-ziplist-value"
 59) "hll-sparse-max-bytes"
 61) "lua-time-limit"
 63) "slowlog-log-slower-than"
 65) "latency-monitor-threshold"
 67) "slowlog-max-len"
 69) "port"
 71) "cluster-announce-port"
 73) "cluster-announce-bus-port"
 75) "tcp-backlog"
 77) "databases"
 79) "repl-ping-slave-period"
 81) "repl-timeout"
 83) "repl-backlog-size"
 85) "repl-backlog-ttl"
 87) "maxclients"
 89) "watchdog-period"
 91) "slave-priority"
 93) "slave-announce-port"
 95) "min-slaves-to-write"
 97) "min-slaves-max-lag"
 99) "hz"
101) "cluster-node-timeout"
103) "cluster-migration-barrier"
105) "cluster-slave-validity-factor"
107) "repl-diskless-sync-delay"
109) "tcp-keepalive"
111) "cluster-require-full-coverage"
113) "cluster-slave-no-failover"
115) "no-appendfsync-on-rewrite"
117) "slave-serve-stale-data"
119) "slave-read-only"
121) "stop-writes-on-bgsave-error"
123) "daemonize"
125) "rdbcompression"
127) "rdbchecksum"
129) "activerehashing"
131) "activedefrag"
133) "protected-mode"
135) "repl-disable-tcp-nodelay"
137) "repl-diskless-sync"
139) "aof-rewrite-incremental-fsync"
141) "aof-load-truncated"
143) "aof-use-rdb-preamble"
145) "lazyfree-lazy-eviction"
147) "lazyfree-lazy-expire"
149) "lazyfree-lazy-server-del"
151) "slave-lazy-flush"
153) "maxmemory-policy"
155) "loglevel"
157) "supervised"
159) "appendfsync"
161) "syslog-facility"
163) "appendonly"
165) "dir"
167) "save"
169) "client-output-buffer-limit"
171) "unixsocketperm"
173) "slaveof"
175) "notify-keyspace-events"
177) "bind"

-- maxmemory 설정을 조회
127.0.0.1:6379> config get maxmemory

-- maxmemory를 4G로 설정
127.0.0.1:6379> config set maxmemory 4G

-- config set으로 설정한 정보를 conf 파일에 작성
127.0.0.1:6379> config rewrite

참고자료

https://redis.io/commands/config-get

 

CONFIG GET – Redis

The CONFIG GET command is used to read the configuration parameters of a running Redis server. Not all the configuration parameters are supported in Redis 2.4, while Redis 2.6 can read the whole configuration of a server using this command. The symmetric c

redis.io

http://redisgate.kr/redis/server/config_get.php

 

CONFIG GET Redis

config_get CONFIG GET 레디스 서버 구성 정보 조회 실행중인 서버에서 구성 정보를 조회한다. 버전 2.6 부터 거의 모든 파라미터를 조회할 수 있다. 구성정보 또는 파라미터는 redis.conf 파일에 지정된

redisgate.kr

SELECT GROUP_CONCAT(NAME) AS GCN
     , GROUP_CONCAT(NAME SEPARATOR ' ') AS GCN2
     , GROUP_CONCAT(AGE ORDER BY AGE DESC SEPARATOR '-') AS GCA
FROM TB1

GROUP_CONCAT(컬럼명) : 해당 테이블 컬럼 데이터를 ',' 단위로 하나의 열로 모아주는 기능
GROUP_CONCAT(컬럼명 SEPARATOR '값') : 저정된 단위로 여러 컬럼을 하나의 열로 모아주는 기능
GROUP_CONCAT(컬럼명 ORDER BY 값 ASC/DESC) : 오름/내림 차순 결과를 하나의 열로 모아주는 기능

참고자료

https://wakestand.tistory.com/577?category=835537 

 

MySQL GROUP_CONCAT 을 이용해 여러 행의 내용 합치는 방법

MySQL에서 GROUP_CONCAT을 이용해 여러 행의 데이터를 한 행에 합쳐서 보여줄 수 있는데 예제를 보면 테이블의 NAME 컬럼 안에는 '수철' 과 '철수' 가 들어있는 것이 보이는데 GROUP_CONCAT(컬럼명) 을 사용

wakestand.tistory.com

 

jira lib 설치

pip install jira

Python 로직

from jira import JIRA

jira_server = 'https://jira.atlassian.com'
jira_Account = 'Username'
jira_Password = 'StrongPassword'
options = {'server':jira_server}
auth_jira = JIRA(options, basic_auth=(jira_Account, jira_Password))

jira_project = 'TEST_PROJECT'
jira_title = '[Test] Jira Page Create by Python'
jira_issue_type = 'Task'
jira_desc = 'Jira Page Create Test !'

jira_labels = 'labels_test'
jira_assignee = 'Username'

# Jira Create
new_issue = auth_jira.create_issue(project=jira_project, summary=jira_title, description=jira_desc, issuetype={'name': jira_issue_type}, labels=[jira_labels], assignee={'name': jira_assignee})

# Jira Status Change
auth_jira.transition_issue(new_issue, "Done")

# Jira Web Link Create
link_title = 'Test URL Link..'
link_url = 'https://testURL.co.kr'

param = {"url":link_url,"title":link_title}
auth_jira.add_simple_link(new_issue, param)

jira_server : 접속 jira 주소를 입력

Jira_Account : Jira 접속 계정

Jira_Password : Jira 접속 비밀번호

 

jira_project : 생성할 Jira 프로젝트명

jira_title : jira 제목

jira_issue_type : jira 이슈 타입

jira_desc : jira 상세 정보

jira_labels : labels 정보, 리스트 형식으로 1개 이상 등록 가능

jira_assignee : jira 할당자

 

link_title : 웹 링크명

link_url : 웹 링크 실제 주소

참고자료

https://jira.readthedocs.io/en/master/examples.html#authentication

 

2. Examples — jira-python 3.0.2.dev21+geb80088 documentation

Attachments let user add files to issues. First you’ll need an issue to which the attachment will be uploaded. Next, you’ll need file itself, that is going to be attachment. File could be file-like object or string, representing path on local machine.

jira.readthedocs.io

 


to Top