Cost estimate vs. actual - do I care?

From: Jay Levitt <jay(dot)levitt(at)gmail(dot)com>
To: pgsql-performance(at)postgresql(dot)org
Subject: Cost estimate vs. actual - do I care?
Date: 2012-01-01 18:59:25
Message-ID: 4F00AD0D.6000501@gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-performance

I gather that a big part of making queries performant is making sure the
planner's estimates reflect reality.

Given a random explain analyze line:

Limit (cost=0.02..943.11 rows=50 width=16) (actual time=0.603..79.729
rows=50 loops=1)

which is the truer statement?

1. As long as costs go up with actual time, you're fine.

2. You should try to ensure that costs go up linearly with actual time.

3. You should try to ensure that costs are as close as possible to actual time.

4. The number "4".

Jay Levitt

Responses

Browse pgsql-performance by date

  From Date Subject
Next Message Mark Mielke 2012-01-01 20:00:10 Re: Cost estimate vs. actual - do I care?
Previous Message Pavel Stehule 2011-12-31 07:49:37 Re: How to clock the time spent for query parsing and planning?