Creating index for convert text to integer
| От | xaviergxf |
|---|---|
| Тема | Creating index for convert text to integer |
| Дата | |
| Msg-id | f4d3874a-50b6-49a8-b943-609aec7a37ad@r42g2000yqj.googlegroups.com обсуждение исходный текст |
| Ответы |
Re: Creating index for convert text to integer
|
| Список | pgsql-general |
Hi,
How can i create a index to index all the fields that has the type
INTEGER, in the following table:
create type properties_types as enum('INTEGER', 'STRING', 'FLOAT');
create table properties_types(
value text NOT NULL,
value_type properties_types NOT NULL
);
insert into properties_types values('1', 'INTEGER');
insert into properties_types values('2', 'INTEGER');
insert into properties_types values('3', 'INTEGER');
insert into properties_types values('4', 'INTEGER');
how do i create index for the integer types?
create index properties_types_index on properties_types
((value ::integer)) where value_type='INTEGER'
Can i use this select with the index?
select valor from properties_types where value::integer<3
Thanks!
В списке pgsql-general по дате отправления: