last30days-skill
AI agent skill that researches any topic across Reddit, X, YouTube, HN, Polymarket, and the web - then synthesizes a grounded summary
Find, fix and verify N+1 and slow MongoDB/SQL queries in JS/TS, Python, Go, Java, Ruby and PHP.
제작자가 쓴 원문
이런 작업을 AI에게 가르치는 Skill, 이것과 함께 쓸 수 있습니다
AI agent skill that researches any topic across Reddit, X, YouTube, HN, Polymarket, and the web - then synthesizes a grounded summary
TimesFM (Time Series Foundation Model) is a pretrained time-series foundation model developed by Google Research for time-series forecasting.
Open-source intelligence for the global theater. Track everything from the corporate/private jets of the wealthy, and spy satellites, to seismic events in one unified interface. Hook an AI agent up to have it parse through data and find previously unseen correlations. The knowledge is available to…
목록은 사용 점수(100점 만점)로 정렬되며 구성은 다음과 같습니다
| 인기 | 12/80 | GitHub 별 또는 주간 다운로드: 큰 쪽 60, 작은 쪽 20 |
|---|---|---|
| 최신성 | 12/12 | 30일 안에 릴리스나 코드 변경이 있으면 만점 |
| 응답 중 | 0/8 | 마지막 점검 때 클라우드 엔드포인트가 응답 |
| 사용 점수 | 24/100 |
품질: 기본 점검 3/3개 통과(표시만, 정렬에는 안 씀) · 상승세: 데이터 없음 (급상승 탭에서만 사용)
쓰고 있는 AI 앱을 고른 다음 설정을 복사하세요.
한 문장으로 AI에게 설치 맡기기
querydig 설치해 줘. https://mcp.popnx.com/i/milankatira-querydig.md 를 따라 하고, 명령을 먼저 보여 주고 내가 승인하면 실행해.내 컴퓨터에서 작업하는 AI(Claude Code, Cursor 등)에 붙여 넣으세요. 단계를 읽고 명령을 보여 준 뒤 승인을 기다립니다. 키도 가입도 필요 없습니다. · AI가 읽을 전체 내용 보기
검사 3/3 통과 · 내 컴퓨터에서 실행돼요 · ✓ 명령 확인 2026년 11월 26일
먼저: 어떤 AI를 쓰시나요?
쓰는 앱을 고르면 아래에 단계가 나옵니다.
Claude에 연결할 수 있지만 먼저 준비가 필요해요
먼저 컴퓨터에 Node.js를 설치하세요 (한 번만) · 컴퓨터용 Claude 앱(Windows 또는 Mac)에서만 되고 웹이나 모바일은 안 돼요
이 메시지를 Claude 채팅에 붙여 넣으세요. AI가 컴퓨터를 확인하고 어떤 파일을 바꿀지 알려 준 뒤 매번 동의를 기다립니다.
이 컴퓨터의 Claude에 MCP server querydig을 설치해 주세요. 순서대로: 1) node -v로 Node.js가 있는지 확인. 없으면 https://nodejs.org/en/download에서 설치하라고 알려 주고 직접 설치하지 마세요. 2) 이 설정만 사용하세요(PopNx MCP 확인 완료): { "mcpServers": { "querydig": { "command": "npx", "args": [ "-y", "querydig", "mcp" ] } } } 3) 바꿀 파일의 전체 경로나 실행할 명령을 알려 주고 제 동의를 기다리세요. 4) 키는 필요 없습니다. 5) 합의한 대로 실행한 뒤 querydig의 도구가 실제로 보이는지 확인하세요.이 메시지에는 키가 없습니다. 키가 필요하면 AI가 파일이나 앱 입력란에 직접 붙여 넣으라고 안내합니다.
이미 설치했나요? 먼저 확인 · 터미널을 열고 이 명령을 입력한 뒤 Enter
node -vMac: ⌘ + Space를 누르고 Terminal 입력 후 Enter
Windows: 시작 메뉴를 열고 Windows PowerShell 입력 후 "열기"
아직 설치하지 않았다면: 공식 다운로드 페이지에서 LTS 버전과 클릭형 설치 파일을 고르세요: Mac은 .pkg · Windows는 .msi. 더블클릭 후 끝까지 진행하면 됩니다. curl 명령은 필요 없습니다
설치가 끝나면 터미널을 닫았다가 다시 열고 같은 명령을 실행하세요. 버전 번호가 나와야 합니다: node -v
한 번 설치하면 Node.js가 필요한 모든 도구에서 쓸 수 있습니다
SettingsDeveloperEdit Config
{
"mcpServers": {
"querydig": {
"command": "npx",
"args": [
"-y",
"querydig",
"mcp"
]
}
}
}querydig을 써서 나에게 무엇을 해 줄 수 있는지 알려 주고, 하나 해 봐✓ Claude가 querydig을 쓰고 있다고 하거나 답에 querydig 도구 이름이 나오면 연결된 거예요
위 명령은 이 값들 없이도 동작합니다. 바꾸고 싶을 때만 제작자 설명대로 추가하세요.
QUERYDIG_DB_URI 선택 사항인 읽기 전용 MongoDB 또는 Postgres URI. 실시간 증거(쿼리 계획, 행 수, 느린 쿼리, 누락된 인덱스)에 사용합니다. 설명은 자동 번역이며 변수 이름은 원문 그대로입니다. 확실하지 않으면 원문을 확인하세요.
메뉴 이름은 2026년 11월 11일에 Anthropic 도움말에서 확인 · 앱 버전에 따라 화면이 조금 다를 수 있어요
ChatGPT는 아직 querydig에 연결할 수 없어요
querydig는 내 컴퓨터에 설치해서 쓰지만 ChatGPT는 웹에서 도는 서버만 연결할 수 있어요
A · querydig에 연결되는 앱 쓰기
B · 데이터베이스 및 데이터셋에서 ChatGPT에 연결되는 다른 서버
같은 분류에서 많이 쓰는 것 중 키 없이 주소만으로 연결되는 것을 골랐어요
Claude Code에 연결할 수 있지만 먼저 준비가 필요해요
먼저 컴퓨터에 Node.js를 설치하세요 (한 번만)
이 메시지를 Claude Code 채팅에 붙여 넣으세요. AI가 컴퓨터를 확인하고 어떤 파일을 바꿀지 알려 준 뒤 매번 동의를 기다립니다.
이 컴퓨터의 Claude Code에 MCP server querydig을 설치해 주세요. 순서대로: 1) node -v로 Node.js가 있는지 확인. 없으면 https://nodejs.org/en/download에서 설치하라고 알려 주고 직접 설치하지 마세요. 2) 이 설정만 사용하세요(PopNx MCP 확인 완료): claude mcp add --scope user querydig -- npx -y querydig mcp 3) 바꿀 파일의 전체 경로나 실행할 명령을 알려 주고 제 동의를 기다리세요. 4) 키는 필요 없습니다. 5) 합의한 대로 실행한 뒤 querydig의 도구가 실제로 보이는지 확인하세요.이 메시지에는 키가 없습니다. 키가 필요하면 AI가 파일이나 앱 입력란에 직접 붙여 넣으라고 안내합니다.
이미 설치했나요? 먼저 확인 · 터미널을 열고 이 명령을 입력한 뒤 Enter
node -vMac: ⌘ + Space를 누르고 Terminal 입력 후 Enter
Windows: 시작 메뉴를 열고 Windows PowerShell 입력 후 "열기"
아직 설치하지 않았다면: 공식 다운로드 페이지에서 LTS 버전과 클릭형 설치 파일을 고르세요: Mac은 .pkg · Windows는 .msi. 더블클릭 후 끝까지 진행하면 됩니다. curl 명령은 필요 없습니다
설치가 끝나면 터미널을 닫았다가 다시 열고 같은 명령을 실행하세요. 버전 번호가 나와야 합니다: node -v
한 번 설치하면 Node.js가 필요한 모든 도구에서 쓸 수 있습니다
Mac: Command+스페이스를 누르고 Terminal 입력 · Windows: PowerShell 열기
claude mcp add --scope user querydig -- npx -y querydig mcpquerydig이 목록에 있고 연결됨으로 보이면 돼요
querydig을 써서 나에게 무엇을 해 줄 수 있는지 알려 주고, 하나 해 봐✓ Claude Code가 querydig을 쓰고 있다고 하거나 답에 querydig 도구 이름이 나오면 연결된 거예요
위 명령은 이 값들 없이도 동작합니다. 바꾸고 싶을 때만 제작자 설명대로 추가하세요.
QUERYDIG_DB_URI 선택 사항인 읽기 전용 MongoDB 또는 Postgres URI. 실시간 증거(쿼리 계획, 행 수, 느린 쿼리, 누락된 인덱스)에 사용합니다. 설명은 자동 번역이며 변수 이름은 원문 그대로입니다. 확실하지 않으면 원문을 확인하세요.
메뉴 이름은 2026년 11월 11일에 Anthropic 도움말에서 확인 · 앱 버전에 따라 화면이 조금 다를 수 있어요
Cursor에 연결할 수 있지만 먼저 준비가 필요해요
먼저 컴퓨터에 Node.js를 설치하세요 (한 번만)
이 메시지를 Cursor 채팅에 붙여 넣으세요. AI가 컴퓨터를 확인하고 어떤 파일을 바꿀지 알려 준 뒤 매번 동의를 기다립니다.
이 컴퓨터의 Cursor에 MCP server querydig을 설치해 주세요. 순서대로: 1) node -v로 Node.js가 있는지 확인. 없으면 https://nodejs.org/en/download에서 설치하라고 알려 주고 직접 설치하지 마세요. 2) 이 설정만 사용하세요(PopNx MCP 확인 완료): { "mcpServers": { "querydig": { "command": "npx", "args": [ "-y", "querydig", "mcp" ] } } } 3) 바꿀 파일의 전체 경로나 실행할 명령을 알려 주고 제 동의를 기다리세요. 4) 키는 필요 없습니다. 5) 합의한 대로 실행한 뒤 querydig의 도구가 실제로 보이는지 확인하세요.이 메시지에는 키가 없습니다. 키가 필요하면 AI가 파일이나 앱 입력란에 직접 붙여 넣으라고 안내합니다.
이미 설치했나요? 먼저 확인 · 터미널을 열고 이 명령을 입력한 뒤 Enter
node -vMac: ⌘ + Space를 누르고 Terminal 입력 후 Enter
Windows: 시작 메뉴를 열고 Windows PowerShell 입력 후 "열기"
아직 설치하지 않았다면: 공식 다운로드 페이지에서 LTS 버전과 클릭형 설치 파일을 고르세요: Mac은 .pkg · Windows는 .msi. 더블클릭 후 끝까지 진행하면 됩니다. curl 명령은 필요 없습니다
설치가 끝나면 터미널을 닫았다가 다시 열고 같은 명령을 실행하세요. 버전 번호가 나와야 합니다: node -v
한 번 설치하면 Node.js가 필요한 모든 도구에서 쓸 수 있습니다
querydig을 써서 나에게 무엇을 해 줄 수 있는지 알려 주고, 하나 해 봐✓ Cursor가 querydig을 쓰고 있다고 하거나 답에 querydig 도구 이름이 나오면 연결된 거예요
위 명령은 이 값들 없이도 동작합니다. 바꾸고 싶을 때만 제작자 설명대로 추가하세요.
QUERYDIG_DB_URI 선택 사항인 읽기 전용 MongoDB 또는 Postgres URI. 실시간 증거(쿼리 계획, 행 수, 느린 쿼리, 누락된 인덱스)에 사용합니다. 설명은 자동 번역이며 변수 이름은 원문 그대로입니다. 확실하지 않으면 원문을 확인하세요.
메뉴 이름은 2026년 11월 11일에 Cursor 도움말에서 확인 · 앱 버전에 따라 화면이 조금 다를 수 있어요
VS Code에 연결할 수 있지만 먼저 준비가 필요해요
먼저 컴퓨터에 Node.js를 설치하세요 (한 번만)
이 메시지를 VS Code 채팅에 붙여 넣으세요. AI가 컴퓨터를 확인하고 어떤 파일을 바꿀지 알려 준 뒤 매번 동의를 기다립니다.
이 컴퓨터의 VS Code에 MCP server querydig을 설치해 주세요. 순서대로: 1) node -v로 Node.js가 있는지 확인. 없으면 https://nodejs.org/en/download에서 설치하라고 알려 주고 직접 설치하지 마세요. 2) 이 설정만 사용하세요(PopNx MCP 확인 완료): { "servers": { "querydig": { "type": "stdio", "command": "npx", "args": [ "-y", "querydig", "mcp" ] } } } 3) 바꿀 파일의 전체 경로나 실행할 명령을 알려 주고 제 동의를 기다리세요. 4) 키는 필요 없습니다. 5) 합의한 대로 실행한 뒤 querydig의 도구가 실제로 보이는지 확인하세요.이 메시지에는 키가 없습니다. 키가 필요하면 AI가 파일이나 앱 입력란에 직접 붙여 넣으라고 안내합니다.
이미 설치했나요? 먼저 확인 · 터미널을 열고 이 명령을 입력한 뒤 Enter
node -vMac: ⌘ + Space를 누르고 Terminal 입력 후 Enter
Windows: 시작 메뉴를 열고 Windows PowerShell 입력 후 "열기"
아직 설치하지 않았다면: 공식 다운로드 페이지에서 LTS 버전과 클릭형 설치 파일을 고르세요: Mac은 .pkg · Windows는 .msi. 더블클릭 후 끝까지 진행하면 됩니다. curl 명령은 필요 없습니다
설치가 끝나면 터미널을 닫았다가 다시 열고 같은 명령을 실행하세요. 버전 번호가 나와야 합니다: node -v
한 번 설치하면 Node.js가 필요한 모든 도구에서 쓸 수 있습니다
querydig을 써서 나에게 무엇을 해 줄 수 있는지 알려 주고, 하나 해 봐✓ VS Code가 querydig을 쓰고 있다고 하거나 답에 querydig 도구 이름이 나오면 연결된 거예요
위 명령은 이 값들 없이도 동작합니다. 바꾸고 싶을 때만 제작자 설명대로 추가하세요.
QUERYDIG_DB_URI 선택 사항인 읽기 전용 MongoDB 또는 Postgres URI. 실시간 증거(쿼리 계획, 행 수, 느린 쿼리, 누락된 인덱스)에 사용합니다. 설명은 자동 번역이며 변수 이름은 원문 그대로입니다. 확실하지 않으면 원문을 확인하세요.
메뉴 이름은 2026년 11월 11일에 VS Code 도움말에서 확인 · 앱 버전에 따라 화면이 조금 다를 수 있어요
Claude Code
claude mcp add --scope user querydig -- npx -y querydig mcpClaude Desktop (claude_desktop_config.json)
{
"mcpServers": {
"querydig": {
"command": "npx",
"args": [
"-y",
"querydig",
"mcp"
]
}
}
}Cursor (~/.cursor/mcp.json)
{
"mcpServers": {
"querydig": {
"command": "npx",
"args": [
"-y",
"querydig",
"mcp"
]
}
}
}VS Code (mcp.json)
{
"servers": {
"querydig": {
"type": "stdio",
"command": "npx",
"args": [
"-y",
"querydig",
"mcp"
]
}
}
}QUERYDIG_DB_URI 비밀 env설명은 자동 번역이며 변수 이름은 원문 그대로입니다. 확실하지 않으면 원문을 확인하세요.
이 설정은 제작자의 레지스트리 정보로 만들었어요. README와 다르면 README를 따르세요.
이 서버의 연결 방식과 각 앱의 공식 문서를 바탕으로 했어요. 2026년 11월 10일 확인.
내 컴퓨터에서 실행하는 앱
ClaudeGooseLM StudioMsty StudioCherry StudioCursorVS Code + GitHub CopilotVisual StudioWindsurf (Devin Desktop)ZedKiroClineContinueJetBrains AI AssistantClaude CodeCodex CLIGemini CLIOpenCodenodecodeWarpLibreChatRaycast
내 컴퓨터에서 실행돼요. 설치하면 AI 앱에 도구 목록이 나타나요.
누구나 볼 수 있는 정보를 점검했고, 코드는 읽지 않았어요. 해당하지 않는 항목은 개수에서 뺐어요. · 2026년 11월 26일 점검
레지스트리 이름이 GitHub 계정 milankatira 기준으로 확인되었고, 이 계정이 저장소를 소유하고 있어요
코드 마지막 변경: 어제
MIT 사용
내 컴퓨터에서 실행되는 서버라 인터넷 엔드포인트가 없어요
내 컴퓨터에서 실행되며, 대신 로컬 설정을 사용해요
내 컴퓨터에서 실행돼요. 도구 목록은 인터넷 엔드포인트가 있는 서버에서만 읽을 수 있어요
아직 확인하지 않았습니다
제작자라면 이 코드를 README에 붙여 넣으세요. 배지는 이 페이지로 연결됩니다.
[](https://mcp.popnx.com/en/servers/milankatira-querydig)질문하고, 팁을 나누고, 안 되는 점을 알려 주세요. "도움이 됨"이 많은 순서예요.
아직 리뷰가 없어요
레지스트리에서 이 카테고리의 활성 서버 전체와 비교했어요. 스타는 게시자가 저장소를 소유한 경우에만 세요.
해당하는 기본 점검 3개 중 3개를 통과했어요. 코드는 읽지 않았어요. 키나 토큰을 넣기 전에 서버가 어떤 권한을 요구하는지 확인하고, 꼭 필요한 권한만 있는 키를 쓰세요.
레지스트리에 필수 키가 나와 있지 않아요. 다만 처음 쓸 때 로그인을 요구하는 서버도 있어요.
내 컴퓨터에서 실행돼요. AI 앱이 필요할 때 실행하고, 데이터는 제작자의 서버를 거치지 않아요(서버 자체가 온라인 서비스를 호출하는 경우는 제외).
GitHub 저장소는 마지막으로 어제 변경됐고, 최신 버전(0.8.0)은 오늘 레지스트리에 올라왔어요.
Claude Desktop, Claude Code, Cursor, VS Code처럼 MCP를 지원하는 앱에서 쓸 수 있어요. 내 컴퓨터에 Node.js도 있어야 해요.
같은 카테고리에는: Supabase, Neon, DBCode, Keboola MCP, WaveHouse Cloud
같은 카테고리, 다른 제작자, 명령 확인 완료. 공식이 먼저, 그다음 스타 순.
카드 보는 법:↓ 주간 다운로드i★ GitHub 스타i세 기둥: 리뷰 · 점검 · 사용 정도i업데이트 = 최신 버전을 레지스트리에 공개한 날i
MCP server for interacting with the Supabase platform
Official Neon MCP server for managing Neon projects and Lakebase Postgres databases.
Query and explore 100+ databases through your DBCode connections.
Connect your AI assistants to Keboola and expose your data, transformations, SQL queries, ...
Browse, query, and administer your managed WaveHouse + ClickHouse projects (schema, pipes, policy).
| 이 항목 querydig | Supabase | Neon | DBCode | Keboola MCP | WaveHouse Cloud | |
|---|---|---|---|---|---|---|
| 실행 위치 | 컴퓨터에 설치 필요 | 클라우드 또는 컴퓨터 설치 모두 가능 | 클라우드에서 동작, 설치 불필요 | 컴퓨터에 설치 필요 | 클라우드 또는 컴퓨터 설치 모두 가능 | 클라우드에서 동작, 설치 불필요 |
| 키 필요 | 아니요 | 예 | 아니요 | 아니요 | 아니요 | 아니요 |
| Claude에서 +로 추가 | 아니요 | 예 | 예 | 아니요 | 아니요 | 아니요 |
| 기본 점검 | 3/3 | 5/5 | 5/5 | 2/3 | 5/5 | 4/4 |
| 라이선스 | MIT | Apache-2.0 | MIT | NOASSERTION | MIT | Apache-2.0 |
| 가격 | 등록 정보에 비용 없음 | 등록 정보에 비용 없음 | 등록 정보에 비용 없음 | 등록 정보에 비용 없음 | 등록 정보에 비용 없음 | 등록 정보에 비용 없음 |
제작자의 저장소에서 쓰인 그대로 가져왔어요. PopNx MCP가 검토하거나 보증한 내용이 아니에요. HTML, 이미지, 스크립트는 제거했어요. 링크를 누르면 이 사이트를 벗어나요.
Find slow, N+1 and unoptimized database queries before they reach production.
querydig is a zero-config CLI that statically scans your code for MongoDB and SQL query anti-patterns: N+1 queries, nested queries over results (N²), writes in loops, unbounded reads, unanchored regexes, skip()/OFFSET pagination, non-sargable SQL and more. Each finding gets a severity (critical / high / medium / low), the exact location, why it's slow and how to fix it.
npx querydig # scan the current directory
database/sql, Spring Data JPA, Hibernate, JDBC/JdbcTemplate, jOOQ, ActiveRecord, Sequel, Laravel Eloquent/Query Builder, Doctrine, PDO/mysqli). MongoDB also via the Java driver, Spring Data MongoDB, Mongoid and the MongoDB PHP library.--uri at a MongoDB or Postgres replica to confirm full scans, missing and unused indexes, and slow queries.--fail-on, baselines, --diff, SARIF for GitHub code scanning, HTML report.Requires Node.js 22.12+.
CRITICAL QD002 Nested query over another query's results (N² risk) [mongodb]
src/orders.service.ts:7:20 │ o.user = await User.findById(o.userId); User.findById() is executed for every row of orders, which itself came from the database (loop at line 6). fix: Collect the _id values first and run a single User.find({ _id: { $in: values } }), then match results in memory with a Map.
MEDIUM MQ005 sort() without limit() [mongodb] src/search.ts:25:10 │ return User.find({ status }).sort({ createdAt: -1 }).lean(); fix: Add .limit(n) and an index matching filter + sort (ESR order), e.g. createIndex({ status: 1, createdAt: -1 }).
Summary CRITICAL 6 HIGH 16 MEDIUM 7 LOW 12 Query health: F (0/100)
npx querydig [path] # terminal report
npx querydig --format html # writes querydig-report.html (filterable, self-contained) npx querydig --format json -o report.json npx querydig --format sarif -o querydig.sarif npx querydig --format md > querydig.md # for PR comments
npx querydig --fail-on high # exit 1 if any high/critical issue (CI gate) npx querydig --min-severity medium # hide low findings npx querydig --diff origin/main # only files changed vs a branch npx querydig --update-baseline # record existing issues in .querydig-baseline.json npx querydig --baseline .querydig-baseline.json --fail-on high # only NEW issues fail
npx querydig rules # list rules npx querydig explain QD001 # why + before/after example npx querydig init # create querydig.config.json npx querydig --fix # apply safe automatic fixes (see Auto-fix) npx querydig --uri … --emit-indexes # write missing indexes to a script
Add it to a project:
npm i -D querydig
| ID | Severity | DB | Detects |
|---|---|---|---|
| QD001 | high (critical when nested) | any | Query inside a loop / .map / comprehension (N+1) |
| QD002 | critical | any | Query per row of another query's results (N²) |
| QD003 | high | any | insert/update/delete inside a loop. Use bulk APIs |
| QD004 | high | SQL | Lazy-loaded relation in a loop (b.author.name without select_related / includes / with() / JOIN FETCH): Django, SQLAlchemy, Rails, Laravel, JPA |
| QD005 | high | any | new PrismaClient() / MongoClient / Pool / Sequelize / DataSource created inside a handler: a new connection pool per call |
| MQ001 | high | MongoDB | find({}) with no limit (full collection scan) |
| MQ002 | high | MongoDB | Unanchored or case-insensitive $regex |
| MQ003 | high | MongoDB | $where, $function, mapReduce |
| MQ004 | medium | MongoDB | skip() pagination |
| MQ005 | medium | MongoDB | sort() without limit() (suggests an ESR index) |
| MQ006 | medium | MongoDB | $lookup/$unwind/$group before $match |
| MQ007 | medium | MongoDB | Nested or many populate() calls |
| MQ008 | low | MongoDB | countDocuments() used only as an existence check |
| MQ009 | low | MongoDB | $ne / $nin / $not filters |
| MQ010 | low | MongoDB | find() without projection |
| MQ011 | low | MongoDB | Mongoose read without .lean() |
| SQ001 | high | SQL | findMany() / findAll() / objects.all() / db.Find() with no where/limit |
| SQ002 | low | SQL | SELECT * |
| SQ003 | high | SQL | LIKE '%term' |
| SQ004 | high/medium | SQL | UPDATE/DELETE without WHERE, SELECT without WHERE/LIMIT |
| SQ005 | medium | SQL | OFFSET pagination |
| SQ006 | medium | SQL | WHERE LOWER(col) = … (non-sargable) |
| SQ007 | high | SQL | ORDER BY RAND() |
| SQ008 | medium | SQL | NOT IN (SELECT …) |
| SQ009 | low | SQL | count() used only as an existence check (use exists() / exists? / existsBy…) |
| SQ010 | medium | SQL | Whole table loaded to iterate (User.all.each, foreach (User::all() …), for (… : repo.findAll())) |
Built-in noise control: while/for {} polling loops, batching loops (skip/offset in the loop), loops over collections or model classes, and array helpers like arr.find(x => …) or Python str.find() are not flagged.
See findings in your editor as you type, and in any eslint CI run (JS/TS only; the CLI covers every language).
npm i -D querydig
// eslint.config.js (ESLint 9+)
import querydig from 'querydig/eslint';
export default [ querydig.configs.recommended, // optional: { rules: { 'querydig/no-slow-queries': ['error', { minSeverity: 'high', disable: ['MQ010'] }] } }, ];
Options: minSeverity, disable (rule ids), includeTests (tests, fixtures, migrations and seeds are skipped by default) and useConfigFile (default true: rule overrides and ignore from querydig.config.json apply). eslint --fix applies the same safe fixes as querydig --fix.
querydig mcp starts a Model Context Protocol server, so Claude Code, Claude Desktop, Cursor, VS Code and other MCP clients can find slow queries, rewrite them and check their own fixes. querydig does the detection and verification; the assistant does the rewrite. No API key is needed and your code stays local.
claude mcp add querydig -- npx -y querydig mcp
querydig is also listed in the MCP Registry as io.github.milankatira/querydig.
Or in any client's MCP config:
{
"mcpServers": { "querydig": { "command": "npx", "args": ["-y", "querydig", "mcp"], "env": { "QUERYDIG_DB_URI": "postgres://reader:***@replica-host/shop" } } } }
QUERYDIG_DB_URI is optional. Set it to give the assistant live evidence (row counts, query plans, slow queries, missing indexes) without putting the secret in the chat.
| Tool | What it does |
|---|---|
scan_queries | Scan a project (or just files, to verify an edit) and return findings by severity |
get_finding_context | Code around a finding with line numbers, nearby findings and the rule's before/after example |
analyze_snippet | Check a proposed rewrite before it is written to disk |
apply_safe_fixes | Mechanical fixes like --fix; dry run unless dryRun: false |
suggest_indexes | Read-only index plan from live query plans (needs a database) |
explain_rule, list_rules | Rule docs |
The optimize_queries prompt runs the whole loop: scan → safe fixes → rewrite the worst findings one by one → verify each with querydig → summary table. In Claude Code, type /mcp__querydig__optimize_queries.
Static analysis finds the patterns. Live mode connects read-only to MongoDB or Postgres and checks them against reality: how big each collection is, which indexes exist, and what the query planner actually does.
npx querydig --uri "mongodb://reader:***@replica-host/shop"
QUERYDIG_DB_URI="postgres://reader:***@replica-host/shop" npx querydig # keeps the secret out of shell history
What changes:
| ID | Severity | Finds |
|---|---|---|
| LV001 | high / critical | Queries in your code that do a COLLSCAN / Seq Scan on 10k+ rows, with the exact index to create |
| LV002 | medium | Queries that sort in memory |
| LV003 | high / critical | Slow queries from the MongoDB profiler or pg_stat_statements, traced back to the line of code when possible |
| LV004 | low | Indexes that are never used |
| LV005 | medium | Postgres foreign keys without an index that your code filters on |
Every live finding shows its evidence:
CRITICAL QD002 Nested query over another query's results (N² risk) [mongodb]
src/reports.ts:15:25 live: Each iteration does a full scan of orders (300k docs): N × 300k docs read. (high → critical) fix: … Until then, at least add an index: db.orders.createIndex({ userId: 1 })
Safety model
explain('queryPlanner'), and EXPLAIN (GENERIC_PLAN) (PostgreSQL 16+). Queries are planned, never executed.--explain-execute opts into execution stats (executionStats / EXPLAIN ANALYZE, SELECTs only), which do run the query. Use it on a replica.default_transaction_read_only = on) with a 5s statement timeout. MongoDB: secondaryPreferred reads with maxTimeMS: 5000.--live-required makes that an error).Recommended read-only users
// MongoDB
db.createUser({ user: 'querydig', pwd: '…', roles: [{ role: 'read', db: 'shop' }, { role: 'clusterMonitor', db: 'admin' }] })
-- Postgres
CREATE ROLE querydig LOGIN PASSWORD '…'; GRANT pg_read_all_stats TO queryd