AITeky Learn

AiTeky Original Interactive Learning & Practice Intermediate

Enterprise SQL: seek versus scan and the function that disabled the index

Count how many rows an index seek reads against a full scan, see how wrapping a column in a function turns a seek into a scan, and rewrite a month-end report's filters so they can use the index again.

An index only helps when the database can seek into it. A small change to how a filter is written, such as wrapping a column in a function, can silently turn a millisecond lookup into a scan of every row. The query still returns the right answer, only much more slowly.

This course models an index and a scan with small Python programs you can run in your browser. Python stands in for the database: the rows examined are counted, not timed, and the counts are what separate fast from slow. Check your database's documentation for execution plans, function-based indexes and statistics. All data is made up.

  • Learn lessons explain one idea at a time and let you run it.
  • Industry ready lessons decide and justify, and end with interview questions.

No SQL tuning experience is assumed. Basic Python helps.

Locked. Sign up free

Learn

Understand each idea with everyday examples. No coding background needed.

  1. 01 20 min Free sample 🔒 AiTeky Pass Seek and scan Count the rows examined when finding 31 days of orders by reading every row, and when jumping straight into a sorted index.
  2. 02 20 min 🔒 AiTeky Pass The filter that cannot seek See how wrapping a column in a function forces a scan, and how rewriting the same filter as a plain range lets the index do its job.

Industry ready

Real problems from real jobs, and the questions interviewers ask about them.

  1. 03 30 min 🔒 AiTeky Pass On the job: the month-end report that takes 25 minutes A month-end report wraps dates in functions and scans 60 million rows 25 times. Work out the time, compare four fixes by effort and risk, choose, and write the note.

We use essential cookies to run the site. With your permission we also set one anonymous ID to count unique visitors, and analytics cookies to see which pages help learners. Cookie notice

Join AiTeky Learn. It's free.

Create a free account to track your progress, save items for later and get study suggestions.

Sign up free Log in