From: Qingqing Zhou <zhouqq@cs.toronto.edu>
To: pgsql-performance@postgresql.org
Subject: Re: Use of * affect the performance
Date: Mon, 16 Jan 2006 16:55:11 -0500
Message-ID: <dqh4lf$2o66$1@news.hub.org> (raw)
References: <1137422968.1085.25.camel@servidor>
"Marcos" <mjs_ops@gmx.net> wrote
>
> I always think that use of * in SELECT affected in the performance,
> becoming the search slowest.
>
> But I read in the a Postgres book's that it increases the speed of
> search.
>
> And now???? What the more fast?
>
If you mean use "*" vs. "explicitely name all columns of a relation", then
there is almost no difference except the negligible difference in parsing.
If you mean you just want part of the columns of a relation but you still
use "*": Yes, you will save one projection operation for each result row but
you will pay for more network traffic. In the worst case, say your "*"
involves some toast attributes, you just hurt performance. Considering the
benefits is so marginal and dangerous, I suggest stay with the idea that
"only retrive the columns that you are interested in".
Regards,
Qingqing
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: zhouqq@cs.toronto.edu
Subject: Re: Use of * affect the performance
In-Reply-To: <dqh4lf$2o66$1@news.hub.org>
* 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