Re: [GENERAL] substring on bit(n) and bytea types is slow

2016-03-02 Thread Evgeny Morozov
On 2 March 2016 at 00:33, Arjen Nienhuis wrote: > > On Feb 29, 2016 22:26, "Evgeny Morozov" < > evgeny.morozov+list+pg...@shift-technology.com> wrote > > SELECT substring(bitarray from (32 * (n - 1) + 1) for 32) -- bitarray is > a column of type bit(6400) > > FROM array_test_bit > > JOIN gene

Re: [GENERAL] substring on bit(n) and bytea types is slow

2016-03-02 Thread Evgeny Morozov
On 2 March 2016 at 00:33, Arjen Nienhuis wrote: > > On Feb 29, 2016 22:26, "Evgeny Morozov" < > evgeny.morozov+list+pg...@shift-technology.com> wrote > > SELECT substring(bitarray from (32 * (n - 1) + 1) for 32) -- bitarray is > a column of type bit(6400) > > FROM array_test_bit > > JOIN gene

Re: [GENERAL] substring on bit(n) and bytea types is slow

2016-03-01 Thread Arjen Nienhuis
On Feb 29, 2016 22:26, "Evgeny Morozov" < evgeny.morozov+list+pg...@shift-technology.com> wrote > SELECT substring(bitarray from (32 * (n - 1) + 1) for 32) -- bitarray is a column of type bit(6400) > FROM array_test_bit > JOIN generate_series(1, 1) n ON true; Substring on a bit string is n

[GENERAL] substring on bit(n) and bytea types is slow

2016-02-29 Thread Evgeny Morozov
Hi, Queries like this: SELECT substring(bitarray from (32 * (n - 1) + 1) for 32) -- bitarray is a column of type bit(6400) FROM array_test_bit JOIN generate_series(1, 1) n ON true; SELECT substring(bytearr from (8 * (n - 1) + 1) for 8) -- bytearr is a column of type bytea FROM array_test