Using Dry-Run Mode
Dry-run mode lets you preview compression impact without making any changes to your index.
What is Dry-Run?
Section titled “What is Dry-Run?”When you set dry_run=True, Gilial:
- Analyzes your vectors
- Calculates which vectors would be deleted
- Reports estimated savings
- Does NOT delete anything
Basic Usage
Section titled “Basic Usage”curl -X POST http://localhost:8000/compress \ -H "Content-Type: application/json" \ -d '{"strategy": "balanced", "dry_run": true}'Understanding the Results
Section titled “Understanding the Results”The response includes:
{ "original_vectors": 10000, "compressed_vectors": 9739, "original_size_mb": 29.30, "compressed_size_mb": 28.53, "compression_ratio": 0.974, "savings_pct": 2.61}- original_vectors - Starting vector count
- compressed_vectors - Vectors after compression
- savings_pct - Percentage of space saved
- compression_ratio - New size / original size
Workflow Example
Section titled “Workflow Example”# Step 1: Estimate savingscurl http://localhost:8000/estimate?strategy=balanced
# Step 2: Dry-run to confirmcurl -X POST http://localhost:8000/compress \ -H "Content-Type: application/json" \ -d '{"strategy": "balanced", "dry_run": true}'
# Step 3: Apply if happy (if savings > 2%)curl -X POST http://localhost:8000/compress \ -H "Content-Type: application/json" \ -d '{"strategy": "balanced", "dry_run": false}'Best Practices
Section titled “Best Practices”- Always dry-run first - Never jump to
dry_run=False - Review the numbers - Check if savings justify the deletion
- Use for testing - Test compression strategies on a copy before applying
- Monitor queries - Run dry-run before and after to spot impact
- Document changes - Keep records of compression runs
Common Dry-Run Patterns
Section titled “Common Dry-Run Patterns”Check Before Every Compression
Section titled “Check Before Every Compression”Always dry-run first before applying:
# Dry-runcurl -X POST http://localhost:8000/compress \ -d '{"strategy": "balanced", "dry_run": true}' | jq '.savings_pct'
# Only apply if savings look goodcurl -X POST http://localhost:8000/compress \ -d '{"strategy": "balanced", "dry_run": false}'Compare Strategies
Section titled “Compare Strategies”Test both strategies to see which gives better results:
# Test balancedcurl -X POST http://localhost:8000/compress \ -d '{"strategy": "balanced", "dry_run": true}' | jq '.savings_pct'
# Test aggressivecurl -X POST http://localhost:8000/compress \ -d '{"strategy": "aggressive", "dry_run": true}' | jq '.savings_pct'