More than a week ago, I deleted all the rows in a postgresql table (not via truncate
, instead with delete from ...
). Select count (*)
reveals table rows are now 0.
When I now run queries to query disk space, I still see the table taking up space. Specifically, all the indexes still exist and are taking up space. How do I get rid of them and release disk space? Secondly, why do they remain in the first place, when I've gotten rid of all the rows?
Here's the table's detailed description in case warranted:
Table "public.links_photoobjectsubscription"
Column | Type | Modifiers
----------------+--------------------------+----------------------------------------------------------------------------
id | integer | not null default nextval('links_photoobjectsubscription_id_seq'::regclass)
viewer_id | integer | not null
updated_at | timestamp with time zone | not null
seen | boolean | not null
type_of_object | character varying(15) | not null
which_photo_id | integer |
which_link_id | integer |
which_group_id | integer |
which_salat_id | integer |
Indexes:
"links_photoobjectsubscription_pkey" PRIMARY KEY, btree (id)
"links_photoobjectsubscription_seen" btree (seen)
"links_photoobjectsubscription_updated_at" btree (updated_at)
"links_photoobjectsubscription_viewer_id" btree (viewer_id)
"links_photoobjectsubscription_which_photo_id" btree (which_photo_id)
Foreign-key constraints:
"links_photoobjectsubscription_viewer_id_fkey" FOREIGN KEY (viewer_id) REFERENCES auth_user(id) DEFERRABLE INITIALLY DEFERRED
"links_photoobjectsubscription_which_photo_id_fkey" FOREIGN KEY (which_photo_id) REFERENCES links_photo(id) DEFERRABLE INITIALLY DEFERRED
"which_group_id_photoobjectsubscription" FOREIGN KEY (which_group_id) REFERENCES links_group(id) ON DELETE CASCADE
"which_link_id_photoobjectsubscription" FOREIGN KEY (which_link_id) REFERENCES links_link(id) ON DELETE CASCADE
"which_salat_id_photoobjectsubscription" FOREIGN KEY (which_salat_id) REFERENCES links_salatinvite(id) ON DELETE CASCADE