Search Postgresql Archives

Re: Do BRIN indexes support MIN/MAX?

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



> Is it correct that BRIN indexes don't support MIN/MAX operations ?

In theory, it should be possible to implement min/max scan support for BRIN, however it is not implemented yet.

Just in case, min/max query would require to read all BRIN pages, and then it would require to read the corresponding pages in table.

For instance, imagine the table has N pages. Then BRIN would have N/128 pages with the default pages_per_range=128, so your max(..) query would take N/128 + 128 pages to read. In theory it would be sequential, however, under concurrent load it might not be that sequential for the disk.

For instance, 80GiB table would be like 10’000’000 pages, so the default BRIN would take about 78’000 pages (625MiB), so the min/max scan would read 626 MiB
If pages per range is increased to ~3162, then index size would be ~3162 pages (25MiB), and each index entry would cover 25MiB range. Then the query would have to read ~50MiB to fetch min/max. It is not clear if that is really practical though.

What are you data volumes and expectations by the way?

Vladimir

--
Vladimir

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Postgresql Jobs]     [Postgresql Admin]     [Postgresql Performance]     [Linux Clusters]     [PHP Home]     [PHP on Windows]     [Kernel Newbies]     [PHP Classes]     [PHP Databases]     [Postgresql & PHP]     [Yosemite]

  Powered by Linux