superset-sql-developer
БесплатноБез исполняемых скриптовНе проверенExpert guidance for writing optimized SQL queries for Apache Superset datasets, virtual datasets, and SQL Lab. This skill helps you create performant queries…
Об этом скилле
Superset SQL Developer Skill
Purpose
Expert guidance for writing optimized SQL queries for Apache Superset datasets, virtual datasets, and SQL Lab. This skill helps you create performant queries, design efficient datasets, and leverage PostgreSQL features - with specific patterns for Finance SSC, BIR compliance, and Odoo integration.
When to Use This Skill
- Creating new Superset datasets
- Writing SQL for charts and dashboards
- Optimizing slow queries
- Designing virtual datasets
- Building metrics and calculated columns
- Querying Odoo database via Supabase
- Implementing row-level security
SQL Development Workflow
1. Develop in SQL Lab
SQL Lab → Test Query → Verify Results → Save as Dataset
SQL Lab Best Practices:
- Start with
LIMIT 10to test quickly - Use
EXPLAIN ANALYZEto check performance - Save query history for reuse
- Add comments to document logic
2. Create Dataset
Datasets → + Dataset → SQL Query or Table
Dataset Types:
- Physical Table: Direct table reference (fastest)
- Virtual Dataset: SQL query (flexible)
- Jinja Template: Dynamic SQL (advanced)
3. Define Metrics
Dataset → Edit → Metrics Tab → + Add Metric
Metric Examples:
-- Sum of amounts
SUM(amount)
-- Count distinct
COUNT(DISTINCT agency_id)
-- Percentage
SUM(CASE WHEN status = 'Completed' THEN 1 ELSE 0 END) * 100.0 / COUNT(*)
-- Average with filter
AVG(CASE WHEN processing_time_seconds > 0 THEN processing_time_seconds END)
Query Optimization Fundamentals
Performance Targets
Fast Query: < 1 second
Good Query: 1-5 seconds
Acceptable: 5-10 seconds
Needs Work: 10-30 seconds
Too Slow: > 30 seconds (optimize or async)
Query Optimization Checklist
1. Use WHERE Clauses Wisely
-- ✅ GOOD: Filter on indexed columns
SELECT * FROM bir_filing_tracker
WHERE agency_id = 5
AND filing_date >= '2025-10-01'
-- ❌ BAD: No filters, scans entire table
SELECT * FROM bir_filing_tracker
-- ❌ BAD: Function on column prevents index use
SELECT * FROM bir_filing_tracker
WHERE EXTRACT(YEAR FROM filing_date) = 2025
-- ✅ GOOD: Filter allows index use
SELECT * FROM bir_filing_tracker
WHERE filing_date >= '2025-01-01'
AND filing_date < '2026-01-01'
2. Optimize Aggregations
-- ✅ GOOD: Group by indexed columns
SELECT
agency_id,
COUNT(*) as filing_count
FROM bir_filing_tracker
WHERE filing_date >= '2025-01-01'
GROUP BY agency_id
-- ❌ BAD: Group by non-indexed computed value
SELECT
TO_CHAR(filing_date, 'Month YYYY'),
COUNT(*)
FROM bir_filing_tracker
GROUP BY TO_CHAR(filing_date, 'Month YYYY')
-- ✅ BETTER: Group by date-truncated column (can be indexed)
SELECT
DATE_TRUNC('month', filing_date) as month,
COUNT(*)
FROM bir_filing_tracker
GROUP BY DATE_TRUNC('month', filing_date)
3. Join Efficiently
-- ✅ GOOD: Join on indexed foreign keys
SELECT
t.task_name,
a.agency_name,
COUNT(*) as count
FROM month_end_closing_tasks t
INNER JOIN agencies a ON t.agency_id = a.agency_id
WHERE t.closing_period = '2025-10'
GROUP BY t.task_name, a.agency_name
-- ❌ BAD: Cartesian product (missing join condition)
SELECT t.task_name, a.agency_name
FROM month_end_closing_tasks t, agencies a
-- ⚠️ CAUTION: LEFT JOIN might be slower
-- Only use if you need NULL results
SELECT t.*, a.agency_name
FROM month_end_closing_tasks t
LEFT JOIN agencies a ON t.agency_id = a.agency_id
4. Limit Result Sets
-- ✅ GOOD: Use LIMIT for large results
SELECT * FROM document_processing_logs
WHERE processed_at >= CURRENT_DATE
ORDER BY processed_at DESC
LIMIT 1000
-- ✅ GOOD: Use TOP N with window functions
SELECT * FROM (
SELECT
*,
ROW_NUMBER() OVER (PARTITION BY agency_id ORDER BY filing_date DESC) as rn
FROM bir_filing_tracker
) sub
WHERE rn <= 10 -- Top 10 per agency
-- ❌ BAD: No limit, returns millions of rows
SELECT * FROM document_processing_logs
5. Use Appropriate Data Types
-- ✅ GOOD: Specific data types
SELECT
amount::NUMERIC(10,2), -- For money
filing_date::DATE, -- For dates
agency_id::INTEGER -- For IDs
-- ❌ BAD: Casting everything as text
SELECT
amount::TEXT,
filing_date::TEXT,
agency_id::TEXT
PostgreSQL Optimization Features
1. Indexes
-- Check if index exists
SELECT indexname, indexdef
FROM pg_indexes
WHERE tablename = 'bir_filing_tracker';
-- Suggest indexes based on common queries
-- Index on frequently filtered columns
CREATE INDEX idx_bir_filing_agency_date
ON bir_filing_tracker(agency_id, filing_date);
-- Index for status queries
CREATE INDEX idx_bir_filing_status
ON bir_filing_tracker(filing_status)
WHERE filing_status IN ('Pending', 'Overdue'); -- Partial index
-- Composite index for joins
CREATE INDEX idx_closing_tasks_lookup
ON month_end_closing_tasks(agency_id, closing_period, task_status);
2. Materialized Views
-- Create materialized vi
Установить superset-sql-developer в Claude Code и Claude Desktop
Зарегайся, чтобы установить скилл
Создай бесплатный аккаунт, чтобы открыть команду установки и сохранить скилл в библиотеку.
- Открой команду установки в одну строку
- Сохраняй скиллы в синхронизируемую библиотеку
- Уведомления, когда скиллы обновляются
Разрешённые инструменты
Инструменты, которые скиллу разрешено вызывать.
Без ограничений — скилл может использовать любой инструмент.
Вложенные файлы
FAQ
Что делает скилл superset-sql-developer?
Expert guidance for writing optimized SQL queries for Apache Superset datasets, virtual datasets, and SQL Lab. This skill helps you create performant queries, design efficient datasets, and leverage PostgreSQL features - with specific patterns for Finance SSC, BIR compliance, and Odoo integration.
Как установить скилл superset-sql-developer?
Скопируй папку скилла в ~/.claude/skills (вкладка Claude Code выше делает это одной командой), либо поставь как плагин.
Скилл superset-sql-developer запускает скрипты?
Нет, скилл состоит только из инструкций (SKILL.md), без исполняемых скриптов.
Похожие скиллы
doc-coauthoring
Guide users through a structured workflow for co-authoring documentation. Use when user wants to write documentation, proposals, technical specs, decision…
от Anthropicacademy-guide
Stop and check this skill before finishing any reply to a question about how to use Claude or a Claude product — it recommends matching courses, tutorials…
от Anthropicinternal-comms
A set of resources to help me write all kinds of internal communications, using the formats that my company likes to use. Claude should use this skill…
от Anthropicskill-development
This skill should be used when the user wants to "create a skill", "add a skill to plugin", "write a new skill", "improve skill description", "organize skill…
от Anthropic