## Optimizing Report Performance

As your store grows, reports may take longer to load. This guide covers optimization techniques to keep Alpha Insights running fast, even with large amounts of data.

### Understanding Report Performance

### What Affects Speed

- Data volume: More orders = longer processing time
- Date range: Wider ranges = more data to process
- Widget count: More widgets = more calculations
- Filters: Complex filters require more processing
- Server resources: Hosting quality matters

### Typical Load Times

Small stores (< 5,000 orders):1-3 seconds

Medium stores (5,000-50,000 orders):2-8 seconds

Large stores (50,000+ orders):5-15 seconds

Very large stores (500,000+ orders):10-30 seconds

#### Quick Performance Wins

#### 1. Reduce Date Range

Instead of:"All Time" (processes everything)

Use:"Last 30 Days" or "This Month"

Impact: Can reduce load time by 50-90%

#### 2. Limit Table Rows

Data Table settings:

- Max Records: 500 instead of No Limit
- Results Per Page: 25 instead of 200

Impact: Faster initial load, pagination handles rest

#### 3. Reduce Widget Count

Instead of:15 widgets in one report

Use:5-8 widgets, create multiple focused reports

Impact: Faster loading, better user experience

#### 4. Enable Database Indexes

1. Go to Tools → System Status
2. Click Rebuild Database Indexes
3. Wait for completion (1-5 minutes)

When to use: If reports suddenly slow after months of use

Impact: Can improve speed by 30-50%

### Server-Level Optimization

### PHP Memory Limit

Recommended:256MB minimum, 512MB ideal

Check current limit:

1. Alpha Insights → Tools → System Status
2. See PHP Memory Limit

If too low:

- Contact hosting provider to increase
- Or add to wp-config.php:`define('WP_MEMORY_LIMIT', '512M');`

### PHP Version

Minimum: PHP 7.4

Recommended: PHP 8.0 or 8.1

Impact of upgrading:

- PHP 8.0: 20-40% faster than PHP 7.4
- PHP 8.1: Additional 10-15% improvement

How to upgrade: Contact hosting provider or change in hosting control panel

### Database Optimization

Optimize tables monthly:

1. Alpha Insights → Tools → Database
2. Click Optimize Database Tables
3. Wait for completion

What it does:

- Reorganizes data for faster queries
- Removes fragmentation
- Reclaims wasted space

#### Report-Specific Optimizations

### Large Data Tables

If you have table with 10,000+ rows:

1. Set Max Records to 500 or 1000
2. Use filters to narrow data
3. Create focused sub-reports instead of one massive table

### Complex Charts

Line charts with 365+ data points:

- Use weekly or monthly granularity instead of daily
- Or reduce date range

Bar charts with 100+ bars:

- Limit to top 20-50
- Use table for complete data

#### Multiple Metric Charts

Instead of: One chart with 8 metrics

Use: Two charts with 4 metrics each

Or: Primary chart with 2-3 metrics

### Data Retention Management

### Session Data Cleanup

Old session data slows queries:

1. Settings → Data & Privacy
2. Set Session Retention to 90 days
3. Old sessions automatically deleted

Impact: Keeps analytics tables lean

### Archive Old Orders

For multi-year stores:

1. Export orders older than 2 years
2. Store exported data as archive
3. Optionally delete very old orders from database

Caution: Only delete if you have secure backups

#### Background Processing

### Optimize Background Tasks

1. Settings → General → Performance
2. - Balanced: Good for most stores
   - Conservative: If experiencing performance issues

#### Schedule Heavy Tasks

Run intensive tasks during off-peak hours:

- Historical data processing: Midnight
- Database optimization: 3am

### Hosting Optimization

### Hosting Quality Matters

Shared hosting:

- OK for stores under 10,000 orders
- May struggle with complex reports

VPS or managed WordPress:

- Good for most eCommerce stores
- Handles up to 100,000 orders well

Dedicated server:

- Best for large stores (100,000+ orders)
- Can handle complex reports with ease

### Recommended Hosts for Alpha Insights

- WP Engine (managed WordPress)
- Kinsta (managed WordPress)
- SiteGround (shared/cloud)
- Cloudways (managed cloud VPS)
- AWS/DigitalOcean (for advanced users)

#### Monitoring Performance

### System Status Check

1. Go to Alpha Insights → Tools → System Status
2. - PHP version
   - Memory limit
   - Database size
   - Background task queue

#### Slow Query Log

1. Tools → Debug → Slow Query Log
2. See which reports/queries are slowest
3. Focus optimization on those areas

### Troubleshooting Slow Reports

### Issue: Reports take 30+ seconds to load

Check:

1. Date range - reduce to last 30-90 days
2. Number of widgets - reduce to 6-8 max
3. Table row limits - set to 500 max
4. Check hosting resources - may need upgrade

#### Issue: Dashboard is slow

Solutions:

- Disable dashboard widgets you don't use
- Set shorter default date range (Last 7 Days)

### Issue: Background tasks backing up

Check:

1. Tools → Background Tasks
2. See task queue length
3. If 100+ tasks queued, contact support

Solution:

- Verify WP-Cron is working
- May need to enable system cron with host

### Best Practices

- Keep WordPress and PHP updated
- Limit date ranges to what you actually need
- Optimize database monthly
- Monitor system status quarterly
- Don't overload reports with widgets
- Use filters to reduce data volume
- Upgrade hosting if consistently slow