Re: SERIAL or INT8 / Unique BLOB's

From: Dave Trombley <dtrom(at)bumba(dot)net>
To: "Jeffrey W(dot) Baker" <jwbaker(at)acm(dot)org>
Cc: pgsql-general(at)postgresql(dot)org
Subject: Re: SERIAL or INT8 / Unique BLOB's
Date: 2002-01-03 03:15:47
Message-ID: 3C33CCE3.8050806@bumba.net
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

Jeffrey W. Baker wrote:

>
>yabbut, has anyone seen yet if 7.2 can use bigint in an index (on a 32-bit
>machine)?
>

I don't see why it wouldn't! gcc has supported 8-byte longs for a
(*sigh*) long, long, time now. =)
This is on my i686-class linux box, build of yesterday's CVS snapshot:

test=# create table ttab(a int, b serial8);
NOTICE: CREATE TABLE will create implicit sequence 'ttab_b_seq' for
SERIAL column 'ttab.b'
NOTICE: CREATE TABLE / UNIQUE will create implicit index 'ttab_b_key'
for table 'ttab'
CREATE
test=# CREATE INDEX ttab_b_idx ON ttab (a);
CREATE
test=# CREATE FUNCTION populate(int) RETURNS bool AS '
test'# BEGIN
test'# FOR i IN 1..$1 LOOP
test'# INSERT INTO ttab(a) VALUES((i*i)%133);
test'# END LOOP;
test'# RETURN true;
test'# END; ' language 'plpgsql';
CREATE
test=# select populate(90000);
test=# EXPLAIN SELECT * FROM ttab WHERE a = 30 LIMIT 18;
NOTICE: QUERY PLAN:

Limit (cost=0.00..17.07 rows=5 width=12)
-> Index Scan using ttab_b_idx on ttab (cost=0.00..17.07 rows=5
width=12)

EXPLAIN
test=# select * from ttab where a = 30 limit 10;
a | b
----+--------
30 | 136329
30 | 136315
30 | 136253
30 | 136239
30 | 136196
30 | 136182
30 | 136120
30 | 136106
30 | 136063
30 | 136049
(10 rows)

-dj

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Bruce Momjian 2002-01-03 04:56:45 Post-Great Bridge interview
Previous Message Andrew Gould 2002-01-03 03:01:39 Re: copy from ???