Re: Old record migration to another table made the db slower

From: "Tomas Vondra" <tv(at)fuzzy(dot)cz>
To: "Arun P(dot)L" <arunpl(at)hotmail(dot)com>
Cc: "pgsql-general(at)postgresql(dot)org" <pgsql-general(at)postgresql(dot)org>
Subject: Re: Old record migration to another table made the db slower
Date: 2013-09-05 09:05:48
Message-ID: 31830a84b607ff16fdb41ec765d6b819.squirrel@sq.gransy.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

On 5 Září 2013, 8:52, Arun P.L wrote:
> Hi all,
> I have moved a lot of old records from one table say original_data_table
> to another table say old_data_table which is newly created for the old
> records. There were around 15 milliion old records to move. After this
> migration I have done standard vacuum on new old_data_table as well as on
> original_data_ table.
>
> Now the problem is some queries are running very slow especially 'select
> max(date) from one of the table'. Also db seem to be a bit slower after
> all these works. Actual intention of the migration of old records was to
> speed up the original_data_table which is used frequently by users. How
> can I get this problem get this fixed? What are the steps to be followed
> for the same?
> My postgresql version is 7.4.3. Thanks in Advance for your helps,Arun

Hi,

First of all, 7.4 reached end-of-life ~3 years ago. And 7.4.3 is not even
the last release in this branch - there are ~30 updates. Go and upgrade to
7.4.30 now.

We'll need a bit more info about the tables / queries. What exactly have
you done? Show us the commands you've executed. Then show us EXPLAIN
ANALYZE for the queries.

Tomas

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Evan Martin 2013-09-05 09:27:04 Re: Spurious error messages from pg_restore
Previous Message Marc Balmer 2013-09-05 08:56:26 Re: [GENERAL] Call for design: PostgreSQL mugs