I manage a big (some hundreds of gigs) database containing tables with various roles, some of them holding millions of records. Some tables only receive large number of inserts and deletes, some other few inserts and large number of updates.
Database runs on PostgreSQL 8.4 on a Debian 6.0 amd64 system with 16 gigabytes of RAM.
The question is sometimes autovacuum process on a table, takes a very long time (days) to complete. I want to be able to roughly tell how much time a particular vacuum command will take, to be able to decide whether to cancel it or not. Also if there were a progress indicator for postgres vacuum operations, it would be really helpful.
Edit:
I'm not looking for a bullet-proof solution. Just a rough hint on the number of dead tuples or necessary I/O bytes is enough to decide. It is really annoying to have no clue when VACUUM
will finish, whatsoever.
I've seen that pg_catalog.pg_stat_all_tables
has a column for number of dead tuples. So it is possible to have an estimation, even if it means one has to ANALYZE
the table before. On the other hand, autovacuum_vacuum_threshold
and autovacuum_vacuum_scale_factor
settings alone prove that postgres itself knows something about the amount of change on the tables and probably puts it in the hands of the DBA too.
I'm not sure what query to run, because when I run VACUUM VERBOSE
, I see that not only tables, but indexes on them are being processed too.
For some small companies, “supply chain strategy” can be an afterthought – a term meant only for large, multinational corporations that make or distribute complex products. But challenges posed by the 2020 global health crisis have dramatically reshaped supply chain strategies for businesses of all sizes, in all sectors. Virtually any business that depends on a network of vendors, distributors, and customers is subject to disruption.
But what exactly is a supply chain strategy? It’s a holistic plan designed to efficiently organize and manage the flow of goods and materials. Supply chain strategies may support a company’s overall business goals, increase inventory visibility, and boost competitive advantages by anticipating customer demand and market changes. It can also aim to reduce operational inefficiencies, drive down costs, and enable profitable growth.
Here’s a closer look at a few of the potential benefits of having a supply chain strategy.
One prerequisite of achieving business goals is knowing what you need from your vendors and distributors to reach those goals. This means that, as part of your supply chain strategy development, you may want to start by listing how your products move from the original supplier to your company and finally to your customers.
If you receive raw materials to make a product, consider mapping out each source to evaluate how the materials get to your company. This can be hard to document from the inside out, particularly if many parts or materials are coming from multiple suppliers. Some businesses make matters easier by hiring an experienced consultant to conduct the analysis. Regardless of whether you handle this step yourself or outsource it, the next step is to map out the flow to customers, taking care to consider any distributors or logistics companies that are part of the process. Assess factors such as availability, quality standards, delivery timelines, and cost.
An effective supply chain strategy may involve making strategic trade-offs between the cost to the company and the level of service to the customer. A characteristic of outstanding customer service might be, for example, always having every product in stock. But that approach can also lead to excessive inventory, which can, in turn, disrupt manufacturing schedules because too much product was made at one time.
Alternatively, paying too much attention to cost can lower the quality of products, reduce fill rates for customers, or expand delivery times for out-of-stock products. This can lead to customer dissatisfaction and, eventually, diminished sales.
To know where a company needs to go, it first helps to understand where it has been. Consider starting by identifying how much product or raw material your company received from each supplier over the past year, as well as noting the cost. Next, you may choose to determine how reliable the suppliers were in terms of promised price and on-time delivery, which can help you identify any variances and their causes.
Comparing how each vendor performed on an annual basis can help you determine their future value in your supply chain strategy. Consistent inferior performance, for instance, can lead to supply chain instability. But a stable supply chain strategy might use historical data to decide when it’s time to look for alternative vendors that can support consistent operations and increase supply chain efficiency.
Historical data can also be used to help streamline inventory management capabilities. Product quantities and delivery timelines, for example, can be tracked to help increase forecasting accuracy, reducing the chances of either holding excess inventory or encountering shortages. Similarly, cost analysis can help identify trends. If a vendor’s costs are gradually increasing, for example, it might present an opportunity to negotiate better terms. This data can also be used to help optimize budgeting and financial planning processes.
In order to meet customer demand at a sustainable profit margin, every company needs to know exactly where finished inventory and raw materials are within the supply chain.
Cloud-based technologies can enable businesses to see the exact location of all their inventory, from warehouse to store shelves. This end-to-end visibility is key to any effective supply chain strategy. Among the useful cloud-based systems companies can implement are those that include point-of-sale (POS) systems, warehouse management solutions, inventory management solutions, and logistics management solutions.
Some systems even have the ability to communicate with vendors and logistics partners in real time, making it easy to identify the location of finished goods or raw materials, from anywhere, at any time – be they in the vendor’s warehouse, in transit, about to arrive at your business’ loading dock, or on your customer’s doorstep.
Markets evolve quickly. In order to make a profit, it helps if companies can rapidly identify changes in prices, delivery times, and customer demand. Enter cloud-fueled supply chain agility.
Without an agile supply chain strategy, companies might have to wait for end-of-the-month inventory, production, and sales reports to inform changes to their game plan. This method is often so slow that valuable opportunities are missed and potential risks become inescapable. By contrast, the best supply chain management strategies prioritize flexibility and responsiveness, allowing companies to instantly perform dynamic adjustments, usually based on data from daily cloud-based reports. This method enables businesses to quickly adjust operations to meet fluctuating customer demand.
More specifically, cloud-based tools like POS and inventory management solutions can communicate in real time to provide insights that make it easier to shift gears on demand. They also tend to offer AI-fueled predictive analytics capabilities that can further enhance a company’s capacity to meet swiftly changing customer needs.
Rapid innovation is critical for growing businesses, but innovation doesn’t exist in a vacuum. Products must be produced at the right cost and rate for a company to be profitable, and the actual costs to deliver a product must be accurately captured for financial planning.
Decisions made in the early part of product development can ultimately determine success. With the right supply chain strategy, designs can be optimized for “manufacturability” and long-term supply levels. For example, knowing the committed delivery rate and price of raw materials that will be sold to a business for a proposed product will influence the company’s desire to produce and stock that product, if they know they can make a long-term profit.
Due to the dynamic nature of business and markets, no supply chain management strategy should ever take a “set it and forget it” approach. Rapidly changing market conditions, customer demand, competition, technology, and even regulations necessitate a flexible and adaptable supply chain strategy that prioritizes resilience.
Even significant internal business decisions, like new product launches or market expansion, can have an impact on the supply chain and require strategic adjustments.
It’s wise to review and assess your supply chain strategy regularly in order to identify and mitigate new threats, and to reveal opportunities for improvement.
Here’s a supply chain strategy example to illustrate the point. Say AZ Electronics, a niche electronics manufacturer, adopts a supply chain strategy that focuses on a single supplier and just-in-time inventory management. But as market conditions change and consumer preferences shift, they decide to launch a new product. To keep up with the change, they adopt a multiple supplier strategy to ensure that they always have access to necessary raw materials. They also decide to keep higher inventory levels on hand to prevent costly stockouts, despite the potential increase in carrying costs.
By adjusting their supply chain strategy to match their evolving business needs and market changes, AZ Electronics can support growth and stay competitive, even in the face of potentially disruptive external influences.
While it is true that large companies often have very complex supply chains that span multiple countries, even smaller businesses can benefit from carefully managing their supply chains to prevent disruptions and stay competitive. A good supply chain strategy is one that fits into the company’s overall goals, focuses on customer demands, can rapidly adapt to changing market conditions, and helps facilitate an efficient flow of goods from raw material sourcing to the last delivery mile.
A version of this article was originally published on December 12, 2018.
Photo: Getty Images