Welcome to IQToolkit Analyzer!
For a quick overview, see the Project README.
git clone https://github.com/iqtoolkit/iqtoolkit-analyzer.git
cd iqtoolkit-analyzer
poetry install --with dev,test
If you want to use local LLMs, see Ollama Local Setup for installation and usage instructions.
🔥 NEW: Database-Direct EXPLAIN Analysis
The fastest way to analyze queries is now running EXPLAIN directly against your database:
# 1. Create IQToolkit config file
cp ~/.iqtoolkit/config.yaml.example ~/.iqtoolkit/config.yaml
# Edit config.yaml to add your database connection details
# 2. Run EXPLAIN on any query
poetry run python -m iqtoolkit_analyzer \
--config ~/.iqtoolkit/config.yaml \
postgresql \
--db-name my_database \
--sql "SELECT * FROM users WHERE email = 'test@example.com'" \
--output analysis.md
# Or analyze a SQL file
poetry run python -m iqtoolkit_analyzer \
--config ~/.iqtoolkit/config.yaml \
postgresql \
--db-name my_database \
--query-file slow_query.sql \
--output analysis.md
Traditional Methods:
See PostgreSQL Examples for all CLI and log analysis examples.
Quick commands:
poetry run python -m iqtoolkit_analyzer postgresql /path/to/postgresql.logpoetry run python -m iqtoolkit_analyzer postgresql --plan slow_query_plan.jsonMongoDB analysis uses the built-in profiler to collect slow operation data in real-time:
# Connect to MongoDB
mongosh "mongodb://localhost:27017/myapp"
# Enable profiling for operations slower than 100ms
db.setProfilingLevel(2, {slowms: 100})
# Verify profiling is enabled
db.getProfilingStatus()
# Basic analysis with connection string
poetry run python -m iqtoolkit_analyzer mongodb --connection-string "mongodb://localhost:27017" --output ./reports
# Advanced analysis with configuration file
cp docs/examples/.mongodb-config.yml.example .mongodb-config.yml
# Edit .mongodb-config.yml for your environment
poetry run python -m iqtoolkit_analyzer mongodb --config .mongodb-config.yml --output ./reports
# Generate multiple report formats
poetry run python -m iqtoolkit_analyzer mongodb \
--connection-string "mongodb://localhost:27017" \
--output ./reports \
--format json html markdown
mongodb_analysis.json)mongodb_report.html)mongodb_analysis.md)See MongoDB Guide for complete setup and usage instructions.
You can use a .iqtoolkit-analyzer.yml file to set defaults for log format, thresholds, and output. See Configuration.
If installing manually, ensure you have pyyaml, pandas, and tqdm for all features.