Re: Optional skipping of unchanged relations during ANALYZE? - Mailing list pgsql-hackers

From Ilia Evdokimov
Subject Re: Optional skipping of unchanged relations during ANALYZE?
Date
Msg-id b3fc5424-e993-4b3e-b9df-83f7f5f21e79@tantorlabs.com
Whole thread Raw
In response to Re: Optional skipping of unchanged relations during ANALYZE?  (VASUKI M <vasukianand0119@gmail.com>)
List pgsql-hackers
Before posting patches, it would be very helpful to run at least 'make 
check' and 'make check-world' on a build configured with 
--enable-cassert and --enable-tap-tests, as this often helps to catch 
issues early.

A few additional moments:

1. If we determine that statistics already exists, it is not enough to 
only call vac_close_indexes(). We also need to make sure that everything 
else is freed properly: memory contexts, restored privileges, etc. 
Please take a look at the end of do_analyze_rel() for the full cleanup 
sequence.

2. Static functions should be also have their declarations placed at the 
top of the file, following the usual style.

3. The expression (params.options & VACOPT_MISSING_STATS_ONLY) appears 
multiple times. It might be simpler to introduce a local variable such 
as 'missing_stats_only' and use it instead.

4. The message about skipping analyzing for a relation should follow the 
same logging pattern as the message about analyzing a relation, i.e. 
using 'verbose ? INFO : LOG'. See the end of the function for reference.

-- 
Best regards,
Ilia Evdokimov,
Tantor Labs LLC,
https://tantorlabs.com/




pgsql-hackers by date:

Previous
From: Amit Kapila
Date:
Subject: Re: Skipping schema changes in publication
Next
From: Florents Tselai
Date:
Subject: Re: doc: add note that wal_level=logical doesn't set up logical replication in itself