What’s the best way to search for a UPC code in a Database?

4

I take an index on the barcode column as a given.

You could save space if you stored the codes as numbers. Space is time as less bytes can be read faster. Also, the lookup should be faster on numbers. The leading zeros can be reconstructed when needed as UPC-A is a fixed-length code.

Leave a Comment

tech