"C. Bensend" <[EMAIL PROTECTED]> writes:
> So, I went ahead and created an exact copy of this table, with the
> exception of creating all character columns as type char(), not varchar().
> I was pondering if making PostgreSQL worry about the varying lengths
> by using varchar was the problem...

The above transformation is a guaranteed loser in Postgres.

>    And sure enough, counting the rows on the new table takes around
> 148ms.  That's a pretty big difference from 3600ms.

I'm betting that the original table is physically huge because you've
not vacuumed it regularly.  The copying produced a table with no wasted
space, so physically smaller even though the live data is noticeably
bigger (because of all the padding blanks you forced to be added).

Check what VACUUM VERBOSE has to say about each of these tables...

                        regards, tom lane

---------------------------(end of broadcast)---------------------------
TIP 3: if posting/reading through Usenet, please send an appropriate
      subscribe-nomail command to [EMAIL PROTECTED] so that your
      message can get through to the mailing list cleanly

Reply via email to