10 Comments
User's avatar
Bill C. White's avatar

Indexing is how arrays and other pointers to data structures are accessed.

Indexing a database can dramatically improve performance.

A database index is a supplementary data structure that improves data retrieval speeds by avoiding full table scans. Think of it like a book's index: instead of reading every page to find a topic, you jump directly to the referenced page number.

Andrew Smith's avatar

Nice added context!

What else is called “indexing”?

Bill C. White's avatar

C and C++ use pointers to store data, therefore it makes sense for indices to start at zero as well, because the memory address is held by the program counter at 0 first by default, thus making compilation easier.Jan 26, 2020

This is the source of many errors. Called off-by-one (Obiwan) error.

In coding, an "Obi-Wan error" is a nickname for an off-by-one error. It gets its name from the Star Wars character Obi-Wan Kenobi. Think of it like this: if you count from 0 to 9, you have 10 items. Programmers sometimes forget that "0" is a real number. So, they start counting at 1. This makes the loop count off by one.

Computer Dictionary of Information Technology/oh'bee-won" er"*r/ (RPI, from "off-by-one" and the Obi-Wan Kenobi character in "Star Wars")

https://www.computer-dictionary-online.org/definitions-o/obi-wan-error

Andrew Sniderman 🕷️'s avatar

Haha Bill same! I’ve mucked about with SQL too much for that not to be the first thing I thought of. I’m building this website for a client rn and I’m redoing her search and the other database term that popped back in my head was VIEWS. Can i buy a foreign key? I’m going to drop you.

Bill C. White's avatar

Haha! Same here.

In 2000-2001 I was a web developer (programmer!) for intranet database access to replace JD Edwards OS/400 weaknesses. I wrote SQL every day in PostgreSQL in those days.

Andrew Sniderman 🕷️'s avatar

Badass; I have fond memories of baby iron AS/400 when everyone had a cute lil server room. Back when we were real scientists touching the beast

Bill C. White's avatar

I also wrote a program to migrate data from the AS/400 accounting and from EDI from our vendors (ink jet knockoff cartridges) using Java, which I never much since I was a C++ guy. After that stint in the business world, I switched to science and bioinformatics (computer science applied to biology.) Never looked back until I retired in 2018 due to MS issues.