Re: A question about Vacuum analyze - Mailing list pgsql-general

From Christopher Browne
Subject Re: A question about Vacuum analyze
Date
Msg-id 87wtfttmj6.fsf@wolfe.cbbrowne.com
Whole thread Raw
In response to A question about Vacuum analyze  (Emi Lu <emilu@encs.concordia.ca>)
Responses Re: A question about Vacuum analyze  (Emi Lu <emilu@encs.concordia.ca>)
List pgsql-general
Quoth emilu@encs.concordia.ca (Emi Lu):
>> no. the suggestion was that a VACUUM is not needed, but that an
>> ANALYZE might be.
>
> Thank you gnari for your answer. But I am a bit confused about not
> running vacuum but only "analyze". Can I seperate these two
> operations? I guess "vacuum analyze" do both vacuum and analyze. Or
> "EXPLAIN ANALYZE" can do it for me?

EXPLAIN, ANALYZE, and VACUUM are different things; ANALYZE gets used
in two different contexts...

1.  VACUUM is what cleans dead tuples out of tables.

  e.g. VACUUM my_table;

2.  VACUUM ANALYZE cleans out dead tuples and recalculates data
    distributions

  e.g. VACUUM ANALYZE my_table;

3.  EXPLAIN describes query plans

  e.g. EXPLAIN select * from my_table;

4.  EXPLAIN ANALYZE compares query plan estimates to real results

  e.g. EXPLAIN ANALYZE select * from my_table;

5.  ANALYZE recalculates data distributions (as in 2, but without
    cleaning out dead tuples).

  e.g. ANALYZE my_table;

Pointedly, EXPLAIN ANALYZE is entirely distinct from ANALYZE and
VACUUM ANALYZE...
--
let name="cbbrowne" and tld="cbbrowne.com" in name ^ "@" ^ tld;;
http://linuxdatabases.info/info/slony.html
Rules of the Evil Overlord #218. "I will not pick up a glowing ancient
artifact and shout "Its power is now mine!!!" Instead I will grab some
tongs, transfer  it to a hazardous materials  container, and transport
it back to my lab for study." <http://www.eviloverlord.com/>

pgsql-general by date:

Previous
From: Christopher Browne
Date:
Subject: Re: How do I use the backend APIs
Next
From: "Joshua D. Drake"
Date:
Subject: Re: EnterpriseDB