No description
  • Java 57.5%
  • C# 42.5%
Find a file
2025-12-08 14:08:27 +01:00
cs cs: bump to .Net 9.0 2025-11-25 13:06:14 +01:00
java java: clarify README 2025-12-08 14:08:27 +01:00
.gitignore Initial commit 2021-12-01 09:58:08 +01:00
README.md Fix typo 2024-12-13 14:24:47 +01:00

Contacts database

Goal: measure performance of a simple application in two scenarios - with and without a SQL index

Step 1 - measure performance without an index

Run the main application with a small number of contacts (<100) see various readme by languages on how to do that.

You'll get an error message because the code is not complete, so start by implementing the TODO comments.

Create a document matching the size of the database with the duration of the query (in milliseconds):

size time (in ms)
10 ...
100 ...
1,000 ...
10,000 ...
50,000 ...
100,000 ...
1,000,000... ...

You'll probably notice the code does not work when n gets big (=~ 1,000,000).

Inserting contacts one by one will be to slow, but inserting 1 million contacts at once will probably not work either. You'll have to be smart :)

Make a graph from the table. Does the result match what you would expect ?

Step 2 - measure performance with an index

Redo the measurements, but this time, create an index before inserting the contacts:

CREATE TABLE contacts(
  id INTEGER PRIMARY KEY,
  name TEXT NOT NULL,
  email TEXT NOT NULL
)

CREATE UNIQUE INDEX index_contacts_email ON contacts(email);

Make a graph for the new result. Does it match what you would expect ?