pg.ddx.io  pgsql-performance@postgresql.org mailing list archive  
help / color / mirror / Atom feed
nuderstanding 'explain analyse'
2+ messages / 2 participants
[nested] [flat]

* nuderstanding 'explain analyse'
@ 2004-11-16 21:11  Alexandre Leclerc <alexandre.leclerc@gmail.com>
  0 siblings, 1 reply; 2+ messages in thread

From: Alexandre Leclerc @ 2004-11-16 21:11 UTC (permalink / raw)
  To: pgsql-performance

Hello,

I build two SELECT queries, and in one I used COALESCE with a CASE,
and in the second one I used only CASE statements.

When analysing, I'm getting the exact same result, except the cost.
(For now I have so few data that the results are too fragmented.

If the plans for both queries are exactly the same, should I assume
that the cost will also be the same?

Thanks for any help.
-- 
Alexandre Leclerc



^ permalink  raw  reply  [nested|flat] 2+ messages in thread

* Re: nuderstanding 'explain analyse'
@ 2004-11-17 06:07  Josh Berkus <josh@agliodbs.com>
  parent: Alexandre Leclerc <alexandre.leclerc@gmail.com>
  0 siblings, 0 replies; 2+ messages in thread

From: Josh Berkus @ 2004-11-17 06:07 UTC (permalink / raw)
  To: pgsql-performance@postgresql.org, Alexandre Leclerc <alexandre.leclerc@gmail.com>

Alexandre,

> If the plans for both queries are exactly the same, should I assume
> that the cost will also be the same?

Nope.   A seq scan over 1,000,000,000 rows is going to cost a LOT more than a 
seq scan over 1000 rows, even though it's the same plan.

When you have the data sorted out, post explain analyzes and we'll take a shot 
at it.

-- 
Josh Berkus
Aglio Database Solutions
San Francisco



^ permalink  raw  reply  [nested|flat] 2+ messages in thread


end of thread, other threads:[~2004-11-17 06:07 UTC | newest]

Thread overview: 2+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2004-11-16 21:11 nuderstanding 'explain analyse' Alexandre Leclerc <alexandre.leclerc@gmail.com>
2004-11-17 06:07 ` Josh Berkus <josh@agliodbs.com>

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