From: | Steve Lane <slane(at)moyergroup(dot)com> |
---|---|
To: | <pgsql-admin(at)postgresql(dot)org> |
Subject: | Index (re)-creation speed |
Date: | 2004-02-06 04:36:52 |
Message-ID: | BC487604.9873%slane@moyergroup.com |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Thread: | |
Lists: | pgsql-admin |
All:
Been looking at speed issues related to loading large data sets, and
experimenting with dropping and rebuilding indexes. I noticed some
interesting behavior on the table in question. Here's the table:
Table "test_responses_2"
Attribute | Type | Modifier
-------------------+-------------------+----------
id_response | integer |
id_code | integer |
id_survey | integer |
id_topic | integer |
id_item | integer |
id_administration | integer |
response_int | smallint |
response_txt | character varying |
rec_handle | character varying |
Indices: id_administration_test_key,
id_code_test_key,
id_item_test_key,
id_response_test_key,
id_survey_test_key,
id_topic_test_key
When I drop and rebuild the indexes, they take oddly varying amounts of time
to rebuild. I rebuilt them in the following order, with the following rough
times. I took a guess that the speed of the rebuild might be related to the
number of distinct values in the column -- this seems true in some cases but
not in others. Here are the times:
id_response 38 secs (86000 distinct)
id_topic 33 secs (6 distinct)
id_survey 13 secs (1 distinct)
id_code 39 secs (1444 distinct)
id_item 40 secs (65 distinct)
id_administration 13 secs (1 distinct)
Is there anything I should be learning from this?
-- sgl
=======================================================
Steve Lane
Vice President
The Moyer Group
14 North Peoria St Suite 2H
Chicago, IL 60607
Voice: (312) 433-2421 Email: slane(at)moyergroup(dot)com
Fax: (312) 850-3930 Web: http://www.moyergroup.com
=======================================================
From | Date | Subject | |
---|---|---|---|
Next Message | Tom Lane | 2004-02-06 06:23:01 | Re: Drop indexes inside transaction? |
Previous Message | Steve Lane | 2004-02-06 03:48:35 | Drop indexes inside transaction? |