On Wed, Nov 21, 2018 at 12:55 PM Dmitry Dolgov <9erthali...@gmail.com> wrote: > Well, no, it's callled with ScanDirectionIsForward(dir). But as far as I > remember from the previous discussions the entire topic of backward scan is > questionable for this patch, so I'll try to invest some time in it.
Another thing that I think is related to skip scans that you should be aware of is dynamic prefix truncation, which I started a thread on just now [1]. While I see one big problem with the POC patch I came up with, I think that that optimization is going to be something that ends up happening at some point. Repeatedly descending a B-Tree when the leading column is very low cardinality can be made quite a lot less expensive by dynamic prefix truncation. Actually, it's almost a perfect case for it. I'm not asking anybody to do anything with that information. "Big picture" thinking seems particularly valuable when working on the B-Tree code; I don't want anybody to miss a possible future opportunity. [1] https://postgr.es/m/cah2-wzn_nayk4pr0hrwo0stwhmxjp5qyu+x8vppt030xpqr...@mail.gmail.com -- Peter Geoghegan