Re: [GENERAL] Index Only Scan and Heap Fetches

2017-07-27 Thread Jeff Janes
On Tue, Jul 18, 2017 at 7:21 AM, Mikhail wrote: > Hi guys, > > I'm running the process, that executes "select * from sr where sr.id=210 > for update;", then some calculations and finally "update sr set usage = > where sr.id = 210;". That operation is done in a loop. > > In parallel session i'm r

Re: [GENERAL] Index-only scan on GIN index for COUNT() queries

2017-06-15 Thread Alexander Kuzmenkov
On 15.06.2017 17:43, Seamus Abshere wrote: Theoretically, could support be added for Index-only scans on GIN indexes when only a COUNT() is requested? Hi Seamus, I am working on a patch that adds this possibility for GIN and any other indexes that support bitmap scans. You can follow the deve

Re: [GENERAL] INDEX ONLY scan with expression index

2016-03-07 Thread David G. Johnston
On Mon, Mar 7, 2016 at 11:33 PM, Tom Lane wrote: > James Sewell writes: > > Would anyone be able to shed some light on why expression based indexes > > can't be used for an index only scan? > > I've found a few comments saying this is the case, and I've proven it is > > the case in reality - but

Re: [GENERAL] INDEX ONLY scan with expression index

2016-03-07 Thread Tom Lane
James Sewell writes: > Would anyone be able to shed some light on why expression based indexes > can't be used for an index only scan? > I've found a few comments saying this is the case, and I've proven it is > the case in reality - but I can't seem to find the why. Well, it would help if you po

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

Re: [GENERAL] Index only scan

2012-10-11 Thread Lars Helge Øverland
Thanks all for the help and insights. I will continue to read up on the details of partitioning and pgpool. best regards, Lars On Thu, Oct 11, 2012 at 2:47 AM, Gavin Flower wrote: > On 11/10/12 12:41, Tom Lane wrote: >> >> Gavin Flower writes: >>> >>> On 11/10/12 01:03, Lars Helge Øverland w

Re: [GENERAL] Index only scan

2012-10-10 Thread Gavin Flower
On 11/10/12 12:41, Tom Lane wrote: Gavin Flower writes: On 11/10/12 01:03, Lars Helge Øverland wrote: My question is: Would it be feasible and/or possible to implement index only scans in a way that it could take advantage of several, single-column indexes? For example, a query spanning column

Re: [GENERAL] Index only scan

2012-10-10 Thread Tom Lane
Gavin Flower writes: > On 11/10/12 01:03, Lars Helge Øverland wrote: >> My question is: Would it be feasible and/or possible to implement >> index only scans in a way that it could take advantage of several, >> single-column indexes? For example, a query spanning columns a, b, c >> could take adva

Re: [GENERAL] Index only scan

2012-10-10 Thread Ondrej Ivanič
Hi, On 10 October 2012 23:03, Lars Helge Øverland wrote: > We are now in the process of designing a new component for analytics > and this feature got me thinking we could utilize postgres over other > alternatives like column-oriented databases. Basically we will have a > wide, denormalized tabl

Re: [GENERAL] Index only scan

2012-10-10 Thread Gavin Flower
On 11/10/12 01:03, Lars Helge Øverland wrote: Hi all, first of all thanks for the great new "index only scan" feature in 9.2. We have managed to adapt our app (dhis2.org) to take advantage of it and it really speeds up several queries significantly. We are now in the process of designing a new