Hi All.

I have a website db that is 90% read-only. I have 50 (or so) tiny lookup tables, something like:

\d m_zone
 Column  |  Type   | Modifiers
---------+---------+-----------
 code    | integer | not null
 zone_id | text    |
 descr   | text    |

This one has less than 10 rows, others might hit 100, I doubt any would make it over 500 rows.

All of them have an index on code. I'm thinking of dropping it and creating the index on (code, descr) so that I'd get Index Only Scans.

I host 100 counties (One database, 100 schemas) each will have these 50 tables, so 5,000 small lookup tables.

My question is: Will PG cache only the index (assuming it can always do an Index Only Scan), or will it cache the table as well?

There is very little difference speed wise, my purpose is to reduce cache usage. Right now I assume I have 5000 tables + 5000 indexes in cache.

I'd like to try to cut that down to either 5000 tables, or 5000 indexes (not both).

Thanks for your time,

-Andy


--
Sent via pgsql-general mailing list (pgsql-general@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-general

Reply via email to