I'm a hardware engineer with lots of firmware coding experience in C and assembly ("low level languages"), with some coding exposure to C++ and prelim knowledge with JS, Pascal, etc. ("high level languages").
I have hired a couple of developers to write a Web App that will later handle high volume in traffic. The app is written in .NET Core, PostgreSQL, Vue.js, C#, ... where my syntactical knowledge is zero so I cannot write test routines to prove/disprove anything so am requesting your help as follows --
The developers are contending that it makes virtually no difference in execution of speed whether they store 10-digit and 12-digit numbers in DB fields marked as "text" or as "int" (or long int). These numbers will be searched very frequently with potentially millions of entries, so speed differences will become apparent under heavy load.
The 10-digit numbers are mobile numbers that need to be displayed in the format 00000-00000 and 12-digit numbers are Indian Aadhaar card numbers to be shown as 0000 0000 0000, so instead of formatting these numbers in the front-end JavaScript code, they are storing them formatted as text along with the hyphen and spaces.
My understanding makes me believe that the search of a text like "12345-67890" in a text column containing will be very slow as compared to a search of a number 1234567890 (int) in a column containing ints.
Two reasons for my belief: a) A number is stored in fewer bytes than a string, consequently faster processing and lower storage
b) A text search uses ASCII stored in bytes whereas number searches directly in the bytes, besides the fact that SQL query gets converted to C which gets converted to Assembly, where the optimized machine code will be probably an order of magnitude faster in numerical searches.
Can any of you experts confirm please?
Thank you