Quantcast
Channel: Question and Answer » postgresql
Viewing all articles
Browse latest Browse all 1138

Measure the size of a PostgreSQL table row

$
0
0

I have a PostgreSQL table. select * is very slow whereas select id is nice and quick. I think it may be that the size of the row is very large and it’s taking a while to transport, or it may be some other factor.

I need all of the fields (or nearly all of them), so selecting just a subset isn’t a quick fix. Selecting the fields that I want is still slow.

Here’s my table schema minus the names:

integer                  | not null default nextval('core_page_id_seq'::regclass)
character varying(255)   | not null
character varying(64)    | not null
text                     | default '{}'::text
character varying(255)   | 
integer                  | not null default 0
text                     | default '{}'::text
text                     | 
timestamp with time zone | 
integer                  | 
timestamp with time zone | 
integer                  | 

The size of the text field may be any size. But still, no more than a few kilobytes in the worst case.

Questions

  1. Is there anything about this that screams ‘crazy inefficient’?
  2. Is there a way to measure page size at the Postgres command-line to help me debug this?

Viewing all articles
Browse latest Browse all 1138

Trending Articles