Performance of Bit String

From: rupendra(dot)chulyadyo(at)gmail(dot)com
To: pgsql-hackers(at)postgresql(dot)org
Subject: Performance of Bit String
Date: 2010-06-09 13:11:41
Message-ID: 0016e64dbd7892a019048898a593@google.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Hi,

I tried to store a BitString of length 2 million in a Postgres table (see
code below), but it did not complete even in 3 mins and then I cancelled
it. Surprisingly, it only took few seconds when BitString was of length
500K. Is there any restriction of length of BitString or am I missing
something here?

create table bit_test(
id smallint,
memset bit(200000)
) ;

DECLARE
memset bit varying:= B'0';
BEGIN
--PERFORM memset;
FOR i In 1..2000000 LOOP
memset := (memset || B'1') ; -- (B'1' << i);
END LOOP;

INSERT INTO bit_test VALUES(1,B'1',memset :: bit(2000000));

RETURN bit_length(memset);
END;

Thanks,
Rupendra

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Robert Haas 2010-06-09 13:14:02 Re: Invalid YAML output from EXPLAIN
Previous Message Dimitri Fontaine 2010-06-09 13:06:10 Re: hstore ==> and deprecate =>