Re: [GENERAL] Index Only Scan vs Cache

2015-07-14 Thread William Dunn
On Tue, Jul 14, 2015 at 2:19 PM, Marc Mamin wrote: > > Any rule of the thumb with which number of pages per relation it is worth > to start indexing ? The code for the monitoring tool check_postgres uses table size larger than 5.12kb as a rule of thumb, expecting that for tables smaller than 5.

Re: [GENERAL] Index Only Scan vs Cache

2015-07-14 Thread Andy Colson
On 7/14/2015 1:19 PM, Marc Mamin wrote: On 7/9/2015 12:41 PM, Tom Lane wrote: Andy Colson writes: 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? I'm not sure that indexes on tiny tables are useful. They rais

Re: [GENERAL] Index Only Scan vs Cache

2015-07-14 Thread Marc Mamin
>On 7/9/2015 12:41 PM, Tom Lane wrote: >> Andy Colson writes: >>> 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? I'm not sure that indexes on tiny tables are useful. They raise the options to consider by the q

Re: [GENERAL] Index Only Scan vs Cache

2015-07-14 Thread Pavel Stehule
2015-07-14 11:59 GMT+02:00 Shujie Shang : > Does PG has its own data cache? I don't think so. > PG has own data cache - see shared_buffers Regards Pavel > I think PG just using the filesystem cache. > > On Fri, Jul 10, 2015 at 2:06 AM, Andy Colson wrote: > >> On 7/9/2015 12:41 PM, Tom Lane w

Re: [GENERAL] Index Only Scan vs Cache

2015-07-14 Thread Shujie Shang
Does PG has its own data cache? I don't think so. I think PG just using the filesystem cache. On Fri, Jul 10, 2015 at 2:06 AM, Andy Colson wrote: > On 7/9/2015 12:41 PM, Tom Lane wrote: > >> Andy Colson writes: >> >>> My question is: Will PG cache only the index (assuming it can always do >>>

Re: [GENERAL] Index Only Scan vs Cache

2015-07-09 Thread Andy Colson
On 7/9/2015 12:41 PM, Tom Lane wrote: Andy Colson writes: 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? The table blocks would fall out of cache if they're never touched. regards, tom

Re: [GENERAL] Index Only Scan vs Cache

2015-07-09 Thread Tom Lane
Andy Colson writes: > 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? The table blocks would fall out of cache if they're never touched. regards, tom lane -- Sent via pgsql-general mai

[GENERAL] Index Only Scan vs Cache

2015-07-09 Thread Andy Colson
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 mig