pg.ddx.io  pgsql-performance@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Tom Lane <tgl@sss.pgh.pa.us>
To: SZŰCS Gábor <surrano@mailbox.hu>
Cc: pgsql-performance@postgresql.org
Subject: Re: Relation of cpu_*_costs?
Date: Mon, 07 Jun 2004 09:51:56 -0400
Message-ID: <2604.1086616316@sss.pgh.pa.us> (raw)
In-Reply-To: <076f01c44c62$208aa680$0403a8c0@fejleszt4>
References: <076f01c44c62$208aa680$0403a8c0@fejleszt4>

"=?iso-8859-2?B?U1rbQ1MgR+Fib3I=?=" <surrano@mailbox.hu> writes:
> Last week I fumbled with CPU_TUPLE_COST and revealed that 4 out of 4 tested
> queries improved by 10-60% if I changed it from 0.01 (default) to 0.40
> (ugh). Setting it higher did not bring any improvement.

That's pretty hard to believe; particularly on modern machines, I'd
think that moving it down would make more sense than moving it up.
You're essentially asserting that the CPU time to process one tuple
is almost half of the time needed to bring a page in from disk.

I suspect that your test cases were toy cases small enough to be
fully cached and thus not incur any actual I/O ...

> [ trying to get a nestloop indexscan plan to be generated ]

I believe that the planner's cost model for nestloops with inner
indexscan is wrong: it costs each inner iteration independently, when
in fact there should be some savings, because at least the topmost
levels of the index will soon be fully cached.  However, when I tried
to work out a proper model of this effect, I ended up with equations
that gave higher indexscan costs than what's in there now :-(.  So that
didn't seem like it would make anyone happy.

			regards, tom lane



view thread (3+ messages)  latest in thread

Message-ID: <2604.1086616316@sss.pgh.pa.us>
Permalink:  ../2604.1086616316@sss.pgh.pa.us/
Also on:    postgresql.org/message-id/2604.1086616316@sss.pgh.pa.us

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: pgsql-performance@postgresql.org
  Cc: tgl@sss.pgh.pa.us, surrano@mailbox.hu
  Subject: Re: Relation of cpu_*_costs?
  In-Reply-To: <2604.1086616316@sss.pgh.pa.us>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox