MoreRSS

site iconThe Practical DeveloperModify

A constructive and inclusive social network for software developers.
Please copy the RSS to your reader, or quickly subscribe to:

Inoreader Feedly Follow Feedbin Local Reader

Rss preview of Blog of The Practical Developer

SQL Query Optimization Guide

2026-03-23 23:08:22

SQL Query Optimization Guide

The difference between a query that runs in 50ms and one that runs in 50 seconds is almost never hardware — it's the query plan. This guide teaches you to read execution plans like a pro, choose the right indexes without guessing, partition tables for scale, and recognize the 20 most common SQL anti-patterns that silently destroy performance. Covers PostgreSQL and MySQL with engine-specific examples and EXPLAIN output analysis.

Key Features

  • Execution plan reading guide for both EXPLAIN ANALYZE (PostgreSQL) and EXPLAIN FORMAT=JSON (MySQL) with annotated real-world examples
  • Index strategy framework covering B-tree, hash, GIN, GiST, and partial indexes with decision criteria for each
  • 20 SQL anti-patterns with measured performance impact, detection queries, and refactored solutions
  • Table partitioning patterns for range, list, and hash partitioning with partition pruning verification techniques
  • JOIN optimization techniques including join order hints, materialized CTEs, lateral joins, and when to denormalize
  • Subquery elimination patterns transforming correlated subqueries to JOINs, window functions, and lateral joins
  • Statistics and cardinality management — when to ANALYZE, how to fix bad estimates, and extended statistics in PostgreSQL
  • Query rewrite cookbook with 15 before/after transformations showing plan changes and timing improvements

Quick Start

unzip sql-query-optimization.zip
cd sql-query-optimization/

# Run the query analyzer against your database
psql -h localhost -U admin -d myapp -f src/analysis/find_slow_queries.sql

# Check for missing indexes
psql -h localhost -U admin -d myapp -f src/indexes/index_advisor.sql

# Review anti-patterns in your schema
psql -h localhost -U admin -d myapp -f src/anti_patterns/detect_anti_patterns.sql

Start by finding your worst-performing queries:

-- PostgreSQL: top queries by total execution time
SELECT
    LEFT(query, 80) AS query_preview,
    calls,
    ROUND(total_exec_time::numeric, 1) AS total_ms,
    ROUND(mean_exec_time::numeric, 1) AS mean_ms,
    rows AS avg_rows
FROM pg_stat_statements
WHERE calls > 5
ORDER BY total_exec_time DESC
LIMIT 10;

-- MySQL: equivalent from Performance Schema
SELECT
    DIGEST_TEXT,
    COUNT_STAR AS calls,
    ROUND(SUM_TIMER_WAIT / 1e12, 2) AS total_sec,
    ROUND(AVG_TIMER_WAIT / 1e9, 2) AS avg_ms,
    SUM_ROWS_SENT AS rows_sent
FROM performance_schema.events_statements_summary_by_digest
ORDER BY SUM_TIMER_WAIT DESC
LIMIT 10;

Architecture / How It Works

sql-query-optimization/
├── src/
│   ├── analysis/
│   │   ├── find_slow_queries.sql       # Identify worst performers
│   │   ├── explain_guide.md            # How to read EXPLAIN output
│   │   └── plan_comparison.sql         # Compare plans before/after index
│   ├── indexes/
│   │   ├── index_advisor.sql           # Detect missing indexes
│   │   ├── index_types_guide.md        # B-tree vs GIN vs GiST vs hash
│   │   ├── partial_indexes.sql         # Conditional indexes for filtered queries
│   │   └── covering_indexes.sql        # Include columns to avoid heap access
│   ├── anti_patterns/
│   │   ├── detect_anti_patterns.sql    # Automated anti-pattern detection
│   │   ├── catalog.md                  # 20 anti-patterns with fixes
│   │   └── rewrites/                   # Before/after for each pattern
│   │       ├── select_star.sql
│   │       ├── implicit_cast.sql
│   │       ├── correlated_subquery.sql
│   │       └── or_vs_union.sql
│   ├── partitioning/
│   │   ├── range_partition.sql         # Date-based range partitioning
│   │   ├── list_partition.sql          # Category-based partitioning
│   │   └── partition_pruning_test.sql  # Verify pruning works
│   └── statistics/
│       ├── analyze_schedule.sql        # When and what to ANALYZE
│       └── extended_statistics.sql     # Multi-column statistics (PG 14+)
├── examples/
│   ├── ecommerce_optimization.sql
│   └── reporting_query_tuning.sql
└── config.example.yaml

Usage Examples

Reading an execution plan — what to look for:

EXPLAIN (ANALYZE, BUFFERS, FORMAT TEXT)
SELECT o.id, o.total, c.name
FROM orders o
JOIN customers c ON c.id = o.customer_id
WHERE o.created_at >= '2026-01-01'
  AND o.status = 'completed';

-- Key things to check in the output:
-- 1. Seq Scan on large tables → needs an index
-- 2. "actual rows" >> "planned rows" → stale statistics, run ANALYZE
-- 3. "Buffers: shared read" >> "shared hit" → data not in cache
-- 4. Nested Loop with high outer rows → consider Hash Join
-- 5. Sort with "Sort Method: external merge" → increase work_mem

Anti-pattern: function on indexed column prevents index usage:

-- BAD: function wrapping indexed column forces sequential scan
SELECT * FROM users WHERE UPPER(email) = '[email protected]';
-- Seq Scan on users (cost=0.00..25432.00 rows=1 width=128)
--   Filter: (upper(email) = '[email protected]')

-- FIX OPTION 1: Create a functional index
CREATE INDEX idx_users_email_upper ON users (UPPER(email));

-- FIX OPTION 2: Store normalized data in the column
-- and avoid the function entirely in the query
SELECT * FROM users WHERE email_normalized = '[email protected]';

Anti-pattern: correlated subquery → rewrite as JOIN:

-- BAD: correlated subquery executes once per row in outer query
SELECT
    c.name,
    (SELECT COUNT(*) FROM orders o WHERE o.customer_id = c.id) AS order_count
FROM customers c;
-- Executes N+1 queries (1 for customers + 1 per customer for count)

-- GOOD: LEFT JOIN with GROUP BY — single pass
SELECT
    c.name,
    COUNT(o.id) AS order_count
FROM customers c
LEFT JOIN orders o ON o.customer_id = c.id
GROUP BY c.id, c.name;

-- ALSO GOOD: window function if you need other columns from orders
SELECT DISTINCT ON (c.id)
    c.name,
    COUNT(o.id) OVER (PARTITION BY c.id) AS order_count
FROM customers c
LEFT JOIN orders o ON o.customer_id = c.id;

Partial index for filtered queries:

-- If 95% of queries filter on status = 'active', don't index all rows
CREATE INDEX idx_orders_active ON orders (customer_id, created_at)
    WHERE status = 'active';

-- This index is ~20x smaller than a full index and faster to scan
-- The query must include the WHERE clause for the planner to use it:
SELECT * FROM orders
WHERE status = 'active'
  AND customer_id = 1001
  AND created_at >= '2026-01-01';

Configuration

# config.example.yaml
database:
  engine: postgresql            # postgresql | mysql
  host: localhost
  port: 5432
  database: myapp
  user: admin
  password: YOUR_PASSWORD_HERE

analysis:
  min_calls: 5                  # ignore queries with fewer calls
  min_total_time_ms: 1000       # only flag queries above this total time
  seq_scan_min_rows: 10000      # ignore seq scans on small tables
  cache_hit_warning_pct: 95     # warn if cache hit ratio below this

indexes:
  max_index_per_table: 8        # warn if table has more indexes
  min_usage_since_restart: 10   # flag indexes with fewer than N scans
  check_duplicates: true        # detect overlapping index definitions

partitioning:
  recommend_above_rows: 10000000  # suggest partitioning above 10M rows
  default_strategy: range         # range | list | hash
  partition_period: monthly       # for date-range partitions

Best Practices

  1. Always use EXPLAIN ANALYZE, not just EXPLAIN. The actual row counts and timings reveal plan estimation errors that plain EXPLAIN hides.
  2. Index for your WHERE clause first, then for JOIN columns, then for ORDER BY. This priority order matches the planner's evaluation sequence.
  3. Use covering indexes (INCLUDE clause in PostgreSQL) for queries that read only indexed columns. This avoids heap lookups entirely.
  4. Run ANALYZE after bulk loads. The planner uses table statistics to choose between index scan and sequential scan. Stale statistics produce bad plans.
  5. Prefer EXISTS over IN for subqueries that check existence. EXISTS short-circuits after the first match; IN materializes the entire subquery result.
  6. Monitor pg_stat_user_indexes. Drop indexes with idx_scan = 0 after confirming they're not used for unique constraints or foreign keys.

Troubleshooting

Problem Cause Fix
Planner chooses Seq Scan despite index Stale statistics or small table Run ANALYZE tablename; — if table is small, Seq Scan may actually be faster
Query fast in dev, slow in prod Different data distribution or work_mem Compare EXPLAIN ANALYZE in both environments; check work_mem setting
Index Scan slower than expected High random I/O on spinning disks Set random_page_cost = 1.1 for SSD storage (default 4.0 assumes HDD)
Hash Join using excessive memory Large build input exceeding work_mem Increase work_mem for the session: SET work_mem = '256MB'; before the query

This is 1 of 9 resources in the Database Admin Pro toolkit. Get the complete [SQL Query Optimization Guide] with all files, templates, and documentation for $29.

Get the Full Kit →

Or grab the entire Database Admin Pro bundle (9 products) for $109 — save 30%.

Get the Complete Bundle →

Client CRM & Pipeline

2026-03-23 23:08:14

Client CRM & Pipeline

A Notion-based CRM system designed for freelancers to track leads, manage proposals, monitor active projects, and maintain client relationships — all in one workspace. No expensive SaaS subscriptions required.

What's Included

File Description
crm-database-template.md Complete Notion database schema with properties
pipeline-views.md Board, table, and calendar view configurations
lead-capture-form.md Intake form template for new leads
proposal-tracker.md Proposal status workflow with follow-up sequences
client-record-template.md Individual client profile template
automation-recipes.md Notion formula and automation setup guide
config.example.yaml Configuration for pipeline stage definitions

Quick Start

  1. Extract the ZIP archive
  2. Open crm-database-template.md — it contains the full database schema
  3. Create a Notion database with the specified properties
  4. Configure views using pipeline-views.md as your guide
  5. Import your existing contacts using the provided CSV format
  6. Set up automations for status change notifications

Template Examples

CRM Database Schema

Database: Client Pipeline

Properties:
┌─────────────────┬──────────────┬─────────────────────────────────────┐
│ Property        │ Type         │ Options / Formula                   │
├─────────────────┼──────────────┼─────────────────────────────────────┤
│ Client Name     │ Title        │ —                                   │
│ Stage           │ Select       │ Lead → Contacted → Proposal Sent →  │
│                 │              │ Negotiation → Won → Active → Done   │
│ Deal Value      │ Number       │ Currency format                     │
│ Service Type    │ Multi-select │ Web Dev, Design, Consulting, SEO    │
│ Contact Email   │ Email        │ —                                   │
│ Next Follow-up  │ Date         │ With reminder                       │
│ Lead Source     │ Select       │ Referral, Website, Social, Cold     │
│ Priority        │ Select       │ Hot, Warm, Cold                     │
│ Days in Stage   │ Formula      │ dateBetween(now(), prop("Stage      │
│                 │              │ Changed"), "days")                   │
│ Estimated Close │ Date         │ —                                   │
│ Notes           │ Text         │ Rich text enabled                   │
└─────────────────┴──────────────┴─────────────────────────────────────┘

Pipeline Board View

┌──────────┐ ┌──────────┐ ┌──────────┐ ┌──────────┐ ┌──────────┐
│   LEAD   │ │ PROPOSAL │ │NEGOTIATION│ │   WON    │ │  ACTIVE  │
│          │ │   SENT   │ │          │ │          │ │          │
│ ┌──────┐ │ │ ┌──────┐ │ │ ┌──────┐ │ │ ┌──────┐ │ │ ┌──────┐ │
│ │Acme  │ │ │ │DataCo│ │ │ │Widget│ │ │ │NewCo │ │ │ │RetCo │ │
│ │$5,000│ │ │ │$8,000│ │ │ │$12k  │ │ │ │$3,500│ │ │ │$2k/mo│ │
│ │Web   │ │ │ │SEO   │ │ │ │App   │ │ │ │Design│ │ │ │Maint │ │
│ └──────┘ │ │ └──────┘ │ │ └──────┘ │ │ └──────┘ │ │ └──────┘ │
└──────────┘ └──────────┘ └──────────┘ └──────────┘ └──────────┘

Follow-Up Sequence Template

## Follow-Up Cadence by Stage

### Lead → Contacted (within 24 hours)
- Day 0: Initial response email (use Welcome Template A)
- Day 1: Send portfolio link + relevant case study

### Contacted → Proposal Sent (within 3-5 days)
- Day 3: Send proposal with 2 pricing options
- Day 5: "Just checking in" follow-up if no response
- Day 10: Final follow-up with deadline incentive

### Proposal Sent → Won/Lost (within 14 days)
- Day 7: Phone/video call to discuss questions
- Day 14: Decision deadline — ask for yes/no
- Day 21: Archive as Lost if no response (send breakup email)

Pipeline Metrics Dashboard

## Weekly Pipeline Review

| Metric                    | This Week | Last Week | Trend |
|---------------------------|-----------|-----------|-------|
| New leads added           | ___       | ___       | ↑↓→   |
| Proposals sent            | ___       | ___       | ↑↓→   |
| Win rate (%)              | ___%      | ___%      | ↑↓→   |
| Average deal size         | $____     | $____     | ↑↓→   |
| Pipeline total value      | $____     | $____     | ↑↓→   |
| Avg days to close         | ___       | ___       | ↑↓→   |
| Leads with no follow-up   | ___       | ___       | ↑↓→   |

Usage Tips

  • Update daily. Move cards through stages as soon as status changes
  • Set follow-up dates. Never leave a lead without a scheduled next action
  • Tag lead sources. After 6 months you'll see which channels generate the best clients
  • Archive, don't delete. Lost deals may resurface — keep the history
  • Review weekly. Spend 15 minutes every Monday reviewing your pipeline

Best Practices

  1. Qualify leads early. Use the intake form to filter out poor-fit prospects
  2. Track deal value from day one. Even rough estimates improve forecasting
  3. Use the priority system. Hot leads get same-day responses
  4. Document every interaction in notes. Future-you will thank present-you
  5. Set win/loss reasons. Pattern recognition helps you improve proposals
  6. Clean up monthly. Move stale leads (30+ days no activity) to a "Dormant" stage

This is 1 of 11 resources in the Freelancer Toolkit Pro toolkit. Get the complete [Client CRM & Pipeline] with all files, templates, and documentation for $29.

Get the Full Kit →

Or grab the entire Freelancer Toolkit Pro bundle (11 products) for $149 — save 30%.

Get the Complete Bundle →

Client Onboarding Kit

2026-03-23 23:08:10

Client Onboarding Kit

Professional welcome packets, intake questionnaires, project kick-off checklists, and communication templates that make your first impression as polished as your work. Reduce onboarding time from days to hours.

What's Included

File Description
welcome-packet.md Branded welcome document template
intake-questionnaire.md Comprehensive project intake form
kickoff-checklist.md Step-by-step kick-off meeting agenda
communication-guide.md Response time expectations and channel guide
project-timeline-template.md Milestone-based timeline framework
access-credentials-form.md Secure credential collection template
src/client_onboarding_kit/core.py Python automation for onboarding workflows
src/client_onboarding_kit/utils.py Helper utilities for template generation
config.example.yaml Customization configuration

Quick Start

  1. Extract the ZIP archive
  2. Customize welcome-packet.md with your business name and branding
  3. Select the intake questionnaire variant matching your service type
  4. Send the welcome packet + questionnaire to new clients immediately after signing
  5. Use the kick-off checklist to run your first meeting

Template Examples

Welcome Packet Structure

# Welcome to [YOUR BUSINESS NAME]

Dear [CLIENT NAME],

Thank you for choosing [YOUR BUSINESS] for your [PROJECT TYPE] project.
This packet contains everything you need to know about working with me.

## What Happens Next
1. ✅ Contract signed (done!)
2. 📋 Complete the intake questionnaire (attached)
3. 📅 Kick-off call scheduled for [DATE]
4. 🔑 Share necessary access credentials (secure form attached)
5. 🚀 Project work begins [START DATE]

## How We Communicate
| Channel        | Use For                    | Response Time  |
|----------------|----------------------------|----------------|
| Email          | Non-urgent updates, docs   | Within 24 hrs  |
| Slack/Teams    | Quick questions, approvals | Within 4 hrs   |
| Video Call     | Scheduled meetings only    | By appointment |
| Phone          | Emergencies only           | Within 1 hr    |

## Project Milestones
| Phase          | Deliverable         | Target Date |
|----------------|---------------------|-------------|
| Discovery      | Requirements doc    | Week 1      |
| Design         | Mockups/wireframes  | Week 2-3    |
| Build          | Working prototype   | Week 4-6    |
| Review         | Revision rounds     | Week 7      |
| Launch         | Final delivery      | Week 8      |

## My Working Hours
[YOUR TIMEZONE] — [HOURS, e.g., Mon-Fri 9am-5pm]

Intake Questionnaire (Web Development Variant)

# Project Intake Questionnaire

## About Your Business
1. Business name: ________________
2. Industry/niche: ________________
3. Target audience (describe your ideal customer): ________________
4. Top 3 competitors (URLs if available): ________________

## Project Goals
5. What is the primary goal of this project?
   □ Generate leads  □ Sell products  □ Build authority  □ Other: ____
6. How will you measure success? ________________
7. What's your launch deadline? ________________

## Design Preferences
8. List 3 websites you admire and why: ________________
9. Brand colors (hex codes if available): ________________
10. Existing brand assets? □ Logo □ Style guide □ Photos □ None

## Technical Requirements
11. Current website URL (if redesign): ________________
12. Hosting preference: □ I have hosting □ Need recommendation
13. Required integrations: □ Email marketing □ CRM □ Payment
    □ Analytics □ Social media □ Other: ________________

## Content
14. Who will provide written content? □ Me □ You □ Copywriter
15. Who will provide images/video? □ Me □ Stock □ Photographer
16. Estimated number of pages: ________________

Kick-Off Meeting Checklist

## Kick-Off Meeting Agenda (60 minutes)

### Before the Meeting
- [ ] Review completed intake questionnaire
- [ ] Prepare project timeline draft
- [ ] Set up project management board
- [ ] Create shared folder for deliverables
- [ ] Test screen sharing and recording

### During the Meeting (60 min)
- [ ] (5 min) Introductions and rapport building
- [ ] (10 min) Review project scope and goals
- [ ] (10 min) Walk through timeline and milestones
- [ ] (10 min) Discuss communication preferences
- [ ] (10 min) Review intake questionnaire answers — clarify gaps
- [ ] (10 min) Discuss access/credentials needed
- [ ] (5 min) Confirm next steps and action items

### After the Meeting
- [ ] Send meeting summary email within 2 hours
- [ ] Share project management board access
- [ ] Send credential collection form
- [ ] Schedule first milestone check-in
- [ ] Begin discovery phase

Usage Tips

  • Send the welcome packet within 1 hour of contract signing — first impressions matter
  • Customize the questionnaire to your niche — remove irrelevant questions
  • Record kick-off calls (with permission) so you can reference details later
  • Set response time expectations early. Clients respect boundaries that are stated upfront
  • Use the credential form instead of asking for passwords over email

Best Practices

  1. Automate what you can. The Python scripts generate personalized packets from YAML config
  2. Create niche variants. A web dev questionnaire differs from a copywriting one
  3. Include a FAQ section in your welcome packet — it reduces back-and-forth
  4. Track completion. Follow up if the questionnaire isn't returned within 48 hours
  5. Iterate each quarter. Add questions that you find yourself asking repeatedly
  6. Keep it short. 15-20 questions max on intake — save deep discovery for the kick-off call

This is 1 of 11 resources in the Freelancer Toolkit Pro toolkit. Get the complete [Client Onboarding Kit] with all files, templates, and documentation for $29.

Get the Full Kit →

Or grab the entire Freelancer Toolkit Pro bundle (11 products) for $149 — save 30%.

Get the Complete Bundle →

Freelance Financial Dashboard

2026-03-23 23:08:06

Freelance Financial Dashboard

A pre-built Google Sheets financial tracking system with income logging, expense categorization, tax estimate calculations, profit margin analysis, and monthly/yearly comparison charts. Know your numbers without hiring a bookkeeper.

What's Included

File Description
dashboard-setup-guide.md Step-by-step Google Sheets setup instructions
income-tracker-template.md Revenue logging sheet with formulas
expense-categories.md Pre-configured expense taxonomy
tax-estimator.md Quarterly tax estimate calculator
profit-analysis.md Margin analysis and breakeven formulas
dashboards/main.json Chart configuration for visual dashboard
alerts/rules.yml Threshold alerts for spending and income targets
config.example.yaml Customization settings (tax rates, categories)

Quick Start

  1. Extract the ZIP archive
  2. Open dashboard-setup-guide.md — follow the Google Sheets setup
  3. Copy the template to your Google Drive
  4. Configure your tax rate, expense categories, and income sources in the Settings tab
  5. Log your first month of income and expenses
  6. Review the auto-generated dashboard charts

Template Examples

Income Tracker Sheet

┌──────────┬────────────┬───────────┬──────────┬──────────┬──────────┐
│ Date     │ Client     │ Invoice # │ Amount   │ Category │ Status   │
├──────────┼────────────┼───────────┼──────────┼──────────┼──────────┤
│ 01/15    │ Acme Corp  │ INV-001   │ $3,500   │ Web Dev  │ Paid     │
│ 01/22    │ DataCo     │ INV-002   │ $1,200   │ Consult  │ Paid     │
│ 02/01    │ Example Co │ INV-003   │ $5,000   │ Design   │ Pending  │
├──────────┼────────────┼───────────┼──────────┼──────────┼──────────┤
│          │            │ TOTAL     │ $9,700   │          │          │
└──────────┴────────────┴───────────┴──────────┴──────────┴──────────┘

Key Formulas:
- Monthly total:  =SUMIFS(Amount, Date, ">="&MONTH_START, Date, "<="&MONTH_END)
- Paid total:     =SUMIFS(Amount, Status, "Paid")
- Outstanding:    =SUMIFS(Amount, Status, "Pending")
- Average invoice: =AVERAGE(Amount)

Expense Categories

┌─────────────────────┬────────────────────────────────────┬───────────┐
│ Category            │ Examples                           │ Deductible│
├─────────────────────┼────────────────────────────────────┼───────────┤
│ Software & Tools    │ Hosting, domains, SaaS, licenses   │ Yes       │
│ Office & Workspace  │ Coworking, home office, furniture  │ Yes       │
│ Marketing           │ Ads, SEO tools, business cards     │ Yes       │
│ Professional Dev    │ Courses, books, conferences        │ Yes       │
│ Insurance           │ Liability, health, equipment       │ Yes       │
│ Travel              │ Client meetings, conferences       │ Yes       │
│ Meals & Entertainment│ Client meals (50% deductible)     │ Partial   │
│ Equipment           │ Computer, monitor, peripherals     │ Yes       │
│ Subcontractors      │ Outsourced work, VA                │ Yes       │
│ Bank & Payment Fees │ Stripe fees, wire transfer fees    │ Yes       │
│ Personal/Non-Deduct │ Personal purchases                 │ No        │
└─────────────────────┴────────────────────────────────────┴───────────┘

Quarterly Tax Estimator

Quarterly Tax Estimate — Q[X] [YEAR]

Gross Income (quarter):              $________
Less: Deductible Expenses:           $________
Net Self-Employment Income:          $________

Self-Employment Tax (15.3%):         $________
  → Social Security (12.4%):         $________
  → Medicare (2.9%):                 $________

Estimated Income Tax:
  → Federal (effective rate ____%):  $________
  → State (rate ____%):             $________

TOTAL ESTIMATED TAX DUE:            $________
Set aside per month:                 $________

Formula: =NET_INCOME * (SE_TAX_RATE + FED_RATE + STATE_RATE)

Monthly Dashboard Metrics

═══════════════ JANUARY [YEAR] ═══════════════

Revenue:        $8,500    ▓▓▓▓▓▓▓▓░░ 85% of target
Expenses:       $2,100    ▓▓▓▓░░░░░░ 42% of budget
Net Profit:     $6,400    Margin: 75.3%
Tax Set-Aside:  $2,048    (32% effective rate)
Take-Home:      $4,352

YTD Revenue:    $8,500    vs $7,200 last year (+18%)
YTD Expenses:   $2,100    vs $2,400 last year (-12%)

Usage Tips

  • Log expenses weekly. Don't let receipts pile up — Friday afternoon works well
  • Reconcile monthly. Compare your sheet totals against bank statements
  • Set income targets. Use the target column to track progress against monthly goals
  • Tag everything. Consistent categorization makes tax time painless
  • Use the 30% rule. Set aside 30% of every payment for taxes until you know your actual rate

Best Practices

  1. Separate business and personal accounts. Makes tracking dramatically easier
  2. Photograph receipts immediately. Attach to the expense row as a note
  3. Review profit margins by client. Some clients cost more than they're worth
  4. Update tax estimates quarterly. Adjust based on actual income, not projections
  5. Back up monthly. Download a copy of the spreadsheet at month-end
  6. Share with your accountant. Give view-only access for seamless tax prep

This is 1 of 11 resources in the Freelancer Toolkit Pro toolkit. Get the complete [Freelance Financial Dashboard] with all files, templates, and documentation for $39.

Get the Full Kit →

Or grab the entire Freelancer Toolkit Pro bundle (11 products) for $149 — save 30%.

Get the Complete Bundle →

Proposal &amp; Contract Templates

2026-03-23 23:07:54

Proposal & Contract Templates

10+ professionally structured proposal and contract templates covering web development, design, consulting, copywriting, SEO, and general service engagements. Win more clients with proposals that sell your value, not just your price.

What's Included

File Description
web-development-proposal.md Full-stack web project proposal
design-proposal.md Brand identity and design project proposal
consulting-proposal.md Strategic consulting engagement proposal
copywriting-proposal.md Content and copywriting project proposal
seo-proposal.md SEO audit and optimization proposal
retainer-proposal.md Monthly retainer engagement proposal
general-service-proposal.md Adaptable template for any service
combined-proposal-contract.md Proposal + contract in a single document
pricing-options-template.md Three-tier pricing presentation framework
proposal-cover-letter.md Cover letter and executive summary template
configs/development.yaml Configuration for dev project proposals
configs/production.yaml Configuration for production contracts

Quick Start

  1. Extract the ZIP archive
  2. Choose the template closest to your service type
  3. Customize all [BRACKETED] placeholders with project specifics
  4. Select a pricing structure from the pricing options template
  5. Add your branding — logo, colors, and business info
  6. Export to PDF and send to your prospect

Template Examples

Proposal Structure (Web Development)

# Web Development Proposal
## Prepared for [CLIENT NAME] by [YOUR BUSINESS]

### 1. Executive Summary
[CLIENT NAME] needs a [modern responsive website / e-commerce platform /
web application] to [solve specific problem]. This proposal outlines our
approach, timeline, and investment options.

### 2. Understanding Your Needs
Based on our discovery call on [DATE], your key requirements are:
- [Requirement 1: e.g., Mobile-first responsive design]
- [Requirement 2: e.g., Integration with existing CRM]
- [Requirement 3: e.g., Content management for non-technical staff]

### 3. Proposed Solution
We recommend a [technology/approach] solution that includes:

| Component          | Description                          |
|--------------------|--------------------------------------|
| Frontend           | Responsive design, 8-12 pages        |
| CMS Integration    | Client-managed content updates       |
| SEO Foundation     | Technical SEO, meta tags, sitemap    |
| Performance        | <3s load time, image optimization    |
| Analytics          | Traffic and conversion tracking      |

### 4. Investment Options

| Feature              | Starter    | Professional | Premium    |
|----------------------|------------|--------------|------------|
| Custom Design        | 5 pages    | 10 pages     | 15+ pages  |
| CMS                  | Basic      | Advanced     | Custom     |
| SEO Setup            | Basic      | Full         | Full + Blog|
| Training             | 1 hr       | 2 hrs        | 4 hrs      |
| Support (post-launch)| 30 days    | 60 days      | 90 days    |
| **Investment**       | **$3,500** | **$6,500**   | **$10,000**|

*Most clients choose Professional. → [Recommended]*

Three-Tier Pricing Framework

## Pricing Psychology: The Three-Option Strategy

Always present three options. The middle tier is your target.

### Why Three Tiers Work
- **Tier 1 (Starter):** Establishes a floor. Some clients genuinely need basic.
  Price at 50-60% of your target tier.
- **Tier 2 (Professional):** Your recommended option. Best value positioning.
  This is the price you actually want them to choose.
- **Tier 3 (Premium):** Anchors high. Makes Tier 2 feel reasonable.
  Price at 150-200% of Tier 2. Include premium extras.

### Template:
| | Starter | Professional ★ | Premium |
|---|---|---|---|
| Core deliverable | Minimal | Complete | Complete + extras |
| Revisions | 1 round | 2 rounds | Unlimited |
| Timeline | 4 weeks | 6 weeks | 8 weeks |
| Support | Email only | Email + calls | Dedicated |
| Price | $X | $Y (recommended) | $Z |

Proposal Cover Letter

Dear [CLIENT NAME],

Thank you for taking the time to discuss your [PROJECT TYPE] goals.
After our conversation, I'm confident that [YOUR BUSINESS] is the
right partner for this project.

In this proposal, you'll find:
✓ My understanding of your requirements and goals
✓ A detailed approach and methodology
✓ Three investment options to fit your budget and timeline
✓ Portfolio examples of similar projects
✓ Client testimonials from related engagements

I've kept this proposal concise and action-oriented. If you have
questions, I'm available at [EMAIL] or [PHONE].

This proposal is valid for [14] days from the date above.

Best regards,
[YOUR NAME]
[YOUR BUSINESS]

Usage Tips

  • Customize every proposal. Generic proposals lose. Reference specific client pain points
  • Lead with their problem, not your solution. Show you understand before you prescribe
  • Use the three-tier pricing. It increases average deal size by 20-30%
  • Include a deadline. "Valid for 14 days" creates urgency without pressure
  • Add social proof. Include 1-2 relevant testimonials or case study links
  • Follow up within 48 hours. Ask if they have questions — don't wait passively

Best Practices

  1. Mirror the client's language. Use their terminology, not industry jargon
  2. Quantify the outcome. "Increase conversions by X%" beats "build a better website"
  3. Show your process. Clients buy confidence in your methodology
  4. Separate proposal from contract. Proposal sells; contract protects
  5. Track which tier wins. If everyone picks Starter, your Starter is too generous
  6. A/B test proposals. Try different structures and track your win rate over time

This is 1 of 11 resources in the Freelancer Toolkit Pro toolkit. Get the complete [Proposal & Contract Templates] with all files, templates, and documentation for $29.

Get the Full Kit →

Or grab the entire Freelancer Toolkit Pro bundle (11 products) for $149 — save 30%.

Get the Complete Bundle →

Pricing &amp; Rate Calculator

2026-03-23 23:07:50

Pricing & Rate Calculator

A spreadsheet-based pricing calculator that helps freelancers set profitable rates for hourly, project-based, and retainer engagements. Factors in business expenses, taxes, desired take-home pay, and utilization rate so you never undercharge again.

What's Included

File Description
hourly-rate-calculator.md Bottom-up hourly rate formula sheet
project-pricing-calculator.md Fixed-price project estimation framework
retainer-pricing-calculator.md Monthly retainer value calculator
value-based-pricing-guide.md Guide to pricing based on client outcomes
rate-comparison-worksheet.md Market rate research template
pricing-scenarios.md 5 pre-built pricing scenarios with examples
annual-revenue-planner.md Reverse-engineer income targets
config.example.yaml Default rates, expense assumptions, tax rates

Quick Start

  1. Extract the ZIP archive
  2. Open hourly-rate-calculator.md — start with the bottom-up formula
  3. Input your annual expenses, desired salary, and target hours
  4. Calculate your minimum viable hourly rate
  5. Use project-pricing-calculator.md to convert hourly into project fees
  6. Reference rate-comparison-worksheet.md to validate against market rates

Template Examples

Bottom-Up Hourly Rate Formula

═══════════════ HOURLY RATE CALCULATOR ═══════════════

Step 1: Desired Annual Take-Home Pay
  Target salary:                          $__________

Step 2: Annual Business Expenses
  Software & tools:                       $__________
  Office / coworking:                     $__________
  Insurance:                              $__________
  Marketing & advertising:                $__________
  Professional development:               $__________
  Equipment depreciation:                 $__________
  Accounting & legal:                     $__________
  Miscellaneous (5% buffer):              $__________
  ──────────────────────────────────────
  TOTAL EXPENSES:                         $__________

Step 3: Tax Obligation
  Self-employment tax (15.3%):            $__________
  Federal income tax (est. ____%):        $__________
  State income tax (est. ____%):          $__________
  ──────────────────────────────────────
  TOTAL TAX:                              $__________

Step 4: Required Gross Revenue
  Take-home + Expenses + Taxes =          $__________

Step 5: Billable Hours
  Working weeks per year:                 48 (minus vacation/sick)
  Hours per week:                         40
  Utilization rate:                       60% (admin, marketing, learning)
  ──────────────────────────────────────
  BILLABLE HOURS:                         1,152

Step 6: MINIMUM HOURLY RATE
  = Required Revenue / Billable Hours
  = $__________ / 1,152
  = $__________/hr

  ★ Add 15-20% profit margin:            $__________/hr

Project Pricing Calculator

## Project Price Estimation

### Method: Hours × Rate + Risk Buffer

| Phase            | Estimated Hours | Rate    | Subtotal |
|------------------|-----------------|---------|----------|
| Discovery        | ___             | $___/hr | $___     |
| Design           | ___             | $___/hr | $___     |
| Development      | ___             | $___/hr | $___     |
| Testing/QA       | ___             | $___/hr | $___     |
| Revisions (est.) | ___             | $___/hr | $___     |
| Project mgmt     | ___             | $___/hr | $___     |
|                  |                 |         |          |
| **Subtotal**     | **___**         |         | **$___** |
| Risk buffer (20%)| —               |         | $___     |
| **PROJECT FEE**  |                 |         | **$___** |

### Complexity Multipliers
| Factor                        | Multiplier |
|-------------------------------|------------|
| Tight deadline (<2 weeks)     | 1.25x      |
| Rush job (<1 week)            | 1.5x       |
| Complex integrations          | 1.2x       |
| Enterprise client (legal/IT)  | 1.15x      |
| New technology for you        | 1.1x       |

Retainer Pricing Calculator

## Retainer Value Calculator

### Formula: (Hours × Rate) - Retainer Discount + Guaranteed Income Premium

Monthly hours committed:         ___ hrs
Your hourly rate:                $___/hr
Gross monthly value:             $___

Retainer discount (10-15%):     -$___
Guaranteed income premium:      +$___ (value of predictable income)
──────────────────────────────
MONTHLY RETAINER FEE:            $___

### Retainer Tiers
| Tier     | Hours/Month | Rate     | Monthly Fee | Savings vs Hourly |
|----------|-------------|----------|-------------|-------------------|
| Starter  | 10          | $___/hr  | $___        | 10%               |
| Growth   | 20          | $___/hr  | $___        | 12%               |
| Partner  | 40          | $___/hr  | $___        | 15%               |

Unused hours: □ Roll over (max 1 month) □ Use-it-or-lose-it

Worked Example

EXAMPLE: Web Developer in a mid-cost-of-living city

Target take-home:       $85,000
Business expenses:      $12,000
Taxes (~30%):           $41,571
Required revenue:       $138,571
Billable hours:         1,152
Minimum rate:           $120.28/hr
With 20% margin:        $145/hr

Project pricing:
  Simple website (40 hrs):    $5,800  (40 × $145)
  Complex web app (120 hrs):  $20,880 (120 × $145 × 1.2 complexity)
  Monthly retainer (20 hrs):  $2,552  (20 × $145 × 0.88 discount)

Usage Tips

  • Start with the bottom-up formula. Most freelancers undercharge because they skip this step
  • Use 60% utilization, not 100%. You won't bill 40 hours every week — be realistic
  • Calculate quarterly. As expenses and goals change, so should your rates
  • Never quote hourly for large projects. Use project pricing — it rewards efficiency
  • Round up to the nearest $5 or $10. $145/hr sounds more deliberate than $143.27

Best Practices

  1. Know your floor. Your minimum rate covers costs. Below this, you're losing money
  2. Price for value, not time. A logo worth $50K to the client shouldn't cost $500
  3. Raise rates annually. Minimum 5-10% increase, ideally tied to new skills or results
  4. New clients get new rates. Grandfather existing clients at old rates for 6 months
  5. Track your effective rate. Divide actual payment by actual hours for every project
  6. Don't compete on price. Compete on quality, reliability, and specialization

This is 1 of 11 resources in the Freelancer Toolkit Pro toolkit. Get the complete [Pricing & Rate Calculator] with all files, templates, and documentation for $19.

Get the Full Kit →

Or grab the entire Freelancer Toolkit Pro bundle (11 products) for $149 — save 30%.

Get the Complete Bundle →