Home > database >  Oracle longest to more long string index?
Oracle longest to more long string index?

Time:10-23

Company has a picture of goods: image_id, image_url

Later found the same image_url data too much, so I want to build an index of image_url, if the new goods image_url has been in the garage, it is no longer added

Image_url field is varchar2 (200 char) length is an average of 100 English characters

A: excuse me, can be directly set up index in the field? For the first time for such a long string field index, similarly,

2: do you have any other methods such as take a short summary, and then to the indexed?

CodePudding user response:

1, create the index does not eliminate duplicate values, its purpose is in order to improve the query speed, but is not to say that the more index speed is faster, especially for the indexed field frequently changing table (insert, delete records will lead to be indexed field change, change is that the value of the index also) can cause oracle to recalculate the index, increase the server resource consumption,
2, to prevent the repeat field the field configuration to uniqueness,
3, the public can find a lot of calculation string in the algorithm, namely however is there is a different string may have the same paper, although the probability is small, also is a kind of solution, you consider the length of the value at the same time,
4, don't know where your photos are stored in, if it is fixed on their own server directory, then the URL prefix is no need to stored in the database, as long as the store image file name, so that the field is small,

CodePudding user response:

May I express is not very good, the problem is simple

Can not can be directly to an average length of 100 characters indexed varchar2 fields

CodePudding user response:

refer to the second floor the giraffe CTZ response:
may I express is not very good, the problem is simple

Can not can be directly to an average length of 100 characters varchar2 fields indexed


If can talk, can, of course,
But maybe you should not use the url itself determine it don't exist? May also need a url list, use it to the primary key of the judgment does not exist,

CodePudding user response:

Index has nothing to do with the length of the field,
But according to your description, should first after the existing data to heavy, to create a unique index,

CodePudding user response:

reference 4 floor AHUA1001 response:
index has nothing to do with the length of the field,
But according to your description, should first after the existing data to heavy, to create a unique index,

There is a relationship

CodePudding user response:

refer to the second floor the giraffe CTZ response:
may I express is not very good, the problem is simple

Can not can be directly to an average length of 100 characters varchar2 fields indexed

Indexed directly by, indexed column length limit is 6398
  • Related