Talk About Network

Google


Register and Login
Nick
Password
Register create new account Sign up is FREE and you can post replies, new topics, bookmark posts and more!
Recover lost password


Data Bases > Pgsql Novice > Re: Explain exp...
Latest [ Topics | Posts ] Archive Post A New Topic Post a Reply
<< Topic < Post Post 6 of 12 Topic 3026 of 3323
Post > Topic >>

Re: Explain explained

by markus@[EMAIL PROTECTED] ("Markus Stocker") Mar 4, 2008 at 05:59 PM

On Tue, Mar 4, 2008 at 5:30 PM, Tom Lane <tgl@[EMAIL PROTECTED]
> wrote:
> "Markus Stocker" <markus@[EMAIL PROTECTED]
> writes:
>  > On Tue, Mar 4, 2008 at 1:26 PM, Tom Lane <tgl@[EMAIL PROTECTED]
> wrote:
>
> >>> 2/ Sequential scans seem to me more expensive compared to index
scans.
>  >>> I'm wondering why the sequential scan on individual_name is the
first
>  >>> executed in the plan.
>  >>
>  >> I was wondering that too; it looks like it should be a candidate for
an
>  >> index search.  Datatype problem maybe?  Again, you've not shown us
the
>  >> table definitions...
>
>  > I guess this is explained too now, at least partially.
>
>  No, I meant it seemed like that should have been an indexscan; fetching
>  one row via an index should have an estimated cost much less than 400.
>
>  What do you get if you just do
>  explain select * from individual_name where name =
'http://www.University0.edu'
>  If it still says seqscan, what if you force it with
>  set enable_seqscan = off?

Sorry, I haven't been accurate in my explanations.

If I have an index on individual_name.name then postgresql always
executes an index scan. If I drop it, then it uses a sequential scan
and if I then force it with enable_seqscan = off I get this

                                    QUERY PLAN
--------------------------------------------------------------------------------
 Seq Scan on individual_name  (cost=100000000.00..100000430.67 rows=1
width=68)
   Filter: (name = 'http://www.University0.edu'::text)

So, the query plan in my first email with the sequential scan was
because the index on individual_name.name was dropped. Sorry about
that.

markus

--
Sent via pgsql-novice mailing list (pgsql-novice@[EMAIL PROTECTED]
)
To make changes to your Subscription:
http://mail.postgresql.org/mj/mj_wwwusr?domain=postgresql.org&extra=pgsql-novice
 




 12 Posts in Topic:
Explain explained
markus@[EMAIL PROTECTED]   2008-03-04 09:53:32 
Re: Explain explained
rdeleonp@[EMAIL PROTECTED  2008-03-04 10:21:07 
Re: Explain explained
tgl@[EMAIL PROTECTED] (T  2008-03-04 13:26:17 
Re: Explain explained
markus@[EMAIL PROTECTED]   2008-03-04 15:52:30 
Re: Explain explained
tgl@[EMAIL PROTECTED] (T  2008-03-04 17:30:31 
Re: Explain explained
markus@[EMAIL PROTECTED]   2008-03-04 17:59:45 
numeric definition advice
coder@[EMAIL PROTECTED]   2008-03-07 11:40:55 
Re: numeric definition advice
tgl@[EMAIL PROTECTED] (T  2008-03-07 08:37:30 
Re: numeric definition advice
coder@[EMAIL PROTECTED]   2008-03-07 19:49:04 
warnings restoring a db
coder@[EMAIL PROTECTED]   2008-04-09 08:59:48 
Re: warnings restoring a db
tgl@[EMAIL PROTECTED] (T  2008-04-09 10:43:53 
Re: warnings restoring a db
coder@[EMAIL PROTECTED]   2008-04-09 16:52:00 

Post A Reply:
  Go here to Signup

AddThis Feed Button


About - Advertising - Contact - Frequently Asked Questions - Privacy Policy - Terms of Use - Signup

Contact
tan12V112 Fri Dec 5 5:09:54 CST 2008.