Re: [GENERAL] create index on a field of udt

2015-06-29 Thread Charles Clavadetscher
Cond: ((i).id = 8909) (2 rows) From: pgsql-general-ow...@postgresql.org [mailto:pgsql-general-ow...@postgresql.org] On Behalf Of Jeff Janes Sent: Montag, 29. Juni 2015 08:42 To: Shujie Shang Cc: John R Pierce; PostgreSQL mailing lists Subject: Re: [GENERAL] create index on a field of udt

Re: [GENERAL] create index on a field of udt

2015-06-28 Thread Jeff Janes
On Sun, Jun 28, 2015 at 10:31 PM, Shujie Shang wrote: > Oh, I didn't explain my question well, actually I want to create an index > on an udt in a table. > > e.g. > create type info as (id int, name text); > creat table test (i info); > I want to run: > create index myindex on test (i.id) > > > I

Re: [GENERAL] create index on a field of udt

2015-06-28 Thread John R Pierce
On 6/28/2015 11:24 PM, Shujie Shang wrote: insert into test values (generate_series(1, 300), (1, 'hi')::info); explain select * from test where i.id =1; the result is : seqscan does not every row of that match i.id = 1 ? try ... insert into test values (generate_series(1,

Re: [GENERAL] create index on a field of udt

2015-06-28 Thread Shujie Shang
dex. > > > > Bye > > Charles > > > > > > *From:* pgsql-general-ow...@postgresql.org [mailto: > pgsql-general-ow...@postgresql.org] *On Behalf Of *John R Pierce > *Sent:* Montag, 29. Juni 2015 07:51 > *To:* pgsql-general@postgresql.org > *Subject:* Re: [GEN

Re: [GENERAL] create index on a field of udt

2015-06-28 Thread Charles Clavadetscher
From: pgsql-general-ow...@postgresql.org [mailto:pgsql-general-ow...@postgresql.org] On Behalf Of John R Pierce Sent: Montag, 29. Juni 2015 07:51 To: pgsql-general@postgresql.org Subject: Re: [GENERAL] create index on a field of udt On 6/28/2015 10:31 PM, Shujie Shang wrote: Oh, I didn&#

Re: [GENERAL] create index on a field of udt

2015-06-28 Thread John R Pierce
On 6/28/2015 10:31 PM, Shujie Shang wrote: Oh, I didn't explain my question well, actually I want to create an index on an udt in a table. e.g. create type info as (id int, name text); creat table test (i info); I want to run: create index myindex on test (i.id ) create table

Re: [GENERAL] create index on a field of udt

2015-06-28 Thread Shujie Shang
Oh, I didn't explain my question well, actually I want to create an index on an udt in a table. e.g. create type info as (id int, name text); creat table test (i info); I want to run: create index myindex on test (i.id) On Mon, Jun 29, 2015 at 1:23 PM, John R Pierce wrote: > On 6/28/2015 10:0

Re: [GENERAL] create index on a field of udt

2015-06-28 Thread John R Pierce
On 6/28/2015 10:08 PM, Shujie Shang wrote: create type info as (id int, name text); I want to create index on info.id . you can't create an index on a type, just on a table. create table info (id serial primary key, name text); or create table info (id serial, name t