Skip to main content
17-Peridot
April 27, 2021
Solved

Search Thing by identifier

  • April 27, 2021
  • 2 replies
  • 1036 views

Hi,

Everything can be searched by its identifier. I used to think that this field is indexed. But recently noticed that this field does not have any index in the table thing_model. Is this correct ?

 

Regards,

Sean

Best answer by yhan

Hi @seanccc,

 

After checking twx postgresql database instance, the thing_model table has two below indexes, I think the identifier column value of the thing_model table can be the same in multiple rows and also can be null, so twx doesn't create an index for it OOTB.

  •  CREATE UNIQUE INDEX thing_model_pkey ON twx_schema.thing_model USING btree (entity_id)
  • CREATE UNIQUE INDEX thing_model_name_ukey ON twx_schema.thing_model USING btree (name)

 

 

Thanks,

/Yoyo

2 replies

yhan17-PeridotAnswer
17-Peridot
April 27, 2021

Hi @seanccc,

 

After checking twx postgresql database instance, the thing_model table has two below indexes, I think the identifier column value of the thing_model table can be the same in multiple rows and also can be null, so twx doesn't create an index for it OOTB.

  •  CREATE UNIQUE INDEX thing_model_pkey ON twx_schema.thing_model USING btree (entity_id)
  • CREATE UNIQUE INDEX thing_model_name_ukey ON twx_schema.thing_model USING btree (name)

 

 

Thanks,

/Yoyo

Support
May 3, 2021

Hi @seanccc.

 

If you are satisfied with the response you received, please mark the previous post as the Accepted Solution for the benefit of others with the same question.

 

Regards.

 

--Sharon