pg.ddx.io  pgsql-performance@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: marcin mank <marcin.mank@gmail.com>
To: Bryan Murphy <bmurphy1976@gmail.com>
Cc: pgsql-performance@postgresql.org
Subject: Re: Help Me Understand Why I'm Getting a Bad Query Plan
Date: Wed, 25 Mar 2009 04:04:08 +0100
Message-ID: <b1b9fac60903242004p5fe8b68fwd6f1ada767766b21@mail.gmail.com> (raw)
In-Reply-To: <7fd310d10903241521v1cbf5d7aueca653e03ed98649@mail.gmail.com>
References: <7fd310d10903231203r1bd37b8cn8baeadae83253f44@mail.gmail.com>
	<7fd310d10903241521v1cbf5d7aueca653e03ed98649@mail.gmail.com>

There is one thing I don`t understand:

              ->  Nested Loop  (cost=0.00..180564.28 rows=1806
width=37) (actual time=0.192..60.214 rows=3174 loops=1)
                    ->  Index Scan using visitors_userid_index2 on
visitors v  (cost=0.00..2580.97 rows=1300 width=33) (actual
time=0.052..2.342 rows=897 loops=1)
                          Index Cond: (userid =
'fbe2537f21d94f519605612c0bf7c2c5'::bpchar)
                    ->  Index Scan using
itemexperiencelog__index__visitorid on itemexperiencelog l
(cost=0.00..134.04 rows=230 width=70) (actual time=0.013..0.040 rows=4
loops=897)
                          Index Cond: (l.visitorid = v.id)

If it expects 1300 visitors with the userid, and for each of them to
have 230 entries in itemexperiencelog, how can it come up with 1806
returned rows (and be about right!)?

Greetings
Marcin



view thread (14+ messages)  latest in thread

Message-ID: <b1b9fac60903242004p5fe8b68fwd6f1ada767766b21@mail.gmail.com>
Permalink:  ../b1b9fac60903242004p5fe8b68fwd6f1ada767766b21@mail.gmail.com/
Also on:    postgresql.org/message-id/b1b9fac60903242004p5fe8b68fwd6f1ada767766b21@mail.gmail.com

 · 

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 from your mail client; the link fills in
  the headers below: reply via email
  Some clients, webmail especially, drop In-Reply-To and References from
  a link, and the reply then starts a new thread: use the mbox below.

  To: pgsql-performance@postgresql.org
  Cc: marcin.mank@gmail.com, bmurphy1976@gmail.com
  Subject: Re: Help Me Understand Why I'm Getting a Bad Query Plan
  In-Reply-To: <b1b9fac60903242004p5fe8b68fwd6f1ada767766b21@mail.gmail.com>
  References: <7fd310d10903231203r1bd37b8cn8baeadae83253f44@mail.gmail.com> <7fd310d10903241521v1cbf5d7aueca653e03ed98649@mail.gmail.com> <b1b9fac60903242004p5fe8b68fwd6f1ada767766b21@mail.gmail.com>

* 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