Welcome to the dBforums forums.

You are currently viewing our boards as a guest which gives you limited access to view most discussions, articles and access our other FREE features. By joining our free community you will have access to post topics, communicate privately with other members (PM), respond to polls, upload your own photos and access many other special features. Registration is fast, simple and absolutely free so please, join our community today!

If you have any problems with the registration process or your account login, please contact contact support.

If you prefer not to see double-underlined words and corresponding ads, place your cursor
here for ContentLink opt out.

Go Back  dBforums > Database Server Software > PostgreSQL > ANALYZE parameters?

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 11-14-07, 12:11
amazing.pauper amazing.pauper is offline
Registered User
 
Join Date: Nov 2007
Posts: 1
Unhappy ANALYZE parameters?

Hi All,

I'm relatively inexperienced with PostgreSQL and I've been tasked with analyzing a large never vacuumed database . Is there a way to somehow supply the ANALYZE command with some parameters?
Specifically, I am trying to find an exact number of dead rows in certain tables, and ANALYZE only searches the first (or random?) 3000 pages of a table. Is there a way to increase this number?

Thanks in advance,

amazing.pauper
Reply With Quote
  #2 (permalink)  
Old 11-15-07, 12:20
loquin loquin is offline
Super Moderator
 
Join Date: Jun 2004
Location: Arizona, USA
Posts: 1,359
The PostgreSQL documentation (SQL Commands reference) covers that point pretty thoroughly.

First, Analyze does NOT look at the first 3000 pages. It chooses a random sample of the table contents. Because of this, the results cannot be exact.

To adjust the number of data points for the ANALYZE of a table, use the ALTER TABLE command to change the default_statistics_target_configuration variable upwards. I don't know whether this variable is the number of records to include, or the percentage of records to include. You'll have to investigate this.

If you're worried about the table being locked during the Vacuum Analyze, can't you adjust the Cost-Based Vacuum Delay parameters (ref the documentation, chapter 17, I believe) to make the vacuum process coexist in a busy database? This allows Vacuum to run, but pause every few milliseconds to allow access to the table for other processes. That way, Vacuum can run for as long as it takes to clean things up without seriously affecting the rest of the system.
__________________
Lou
使大吃一惊
"Lisa, in this house, we obey the laws of thermodynamics!" - Homer Simpson
"I have my standards. They may be low, but I have them!" - Bette Middler
"It's a book about a Spanish guy named Manual. You should read it." - Dilbert


Last edited by loquin : 11-15-07 at 13:34.
Reply With Quote
Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On