Re: Function scan/Index scan to nested loop

From: Robert Haas <robertmhaas(at)gmail(dot)com>
To: Carlo Stonebanks <stonec(dot)register(at)sympatico(dot)ca>
Cc: pgsql-performance(at)postgresql(dot)org
Subject: Re: Function scan/Index scan to nested loop
Date: 2010-05-26 04:13:42
Message-ID: AANLkTimT_CB9tkiYynpsLtjhLjOJ6xkiLYeG2prHLWC-@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-performance

On Tue, May 11, 2010 at 2:00 PM, Carlo Stonebanks
<stonec(dot)register(at)sympatico(dot)ca> wrote:
> I am concerned that there is such a lag between all the index and function
> scans start/complete times and and the nested loops starting. I have
> reformatted the SLOW PLAN results below to make them easier to read. Can you
> tell me if this makes any sense to you?

I think you want to run EXPLAIN ANALYZE on the queries that are being
executed BY mdx_core.zips_in_mile_range('75203', 15::numeric) rather
than the query that calls that function. You should be able to see
the same caching effect there and looking at that plan might give you
a better idea what is really happening.

(Note that you might need to use PREPARE and EXPLAIN EXECUTE to get
the same plan the function is generating internally, rather than just
EXPLAIN.)

--
Robert Haas
EnterpriseDB: http://www.enterprisedb.com
The Enterprise Postgres Company

In response to

Browse pgsql-performance by date

  From Date Subject
Next Message Robert Haas 2010-05-26 04:25:56 Re: Performance issues when the number of records are around 10 Million
Previous Message David Jarvis 2010-05-26 03:50:09 Re: Random Page Cost and Planner