Added index on oc_cards increased user create speed

I just wanted to pass along that at least on an 18.0.2 server with 20,000+ user accounts, the OCC creation of accounts was becoming slow on our hardware (>5 seconds each). 16G 16CPUs virtual KVM.

After an strace and a Google on blobs I tried an index on oc_cards. The first is with the index, the second is without. Not sure if this helps anyone else out, but I wanted to pass it along incase it might impact others. Deletes got the biggest benefit. Still would like to get it under 1 sec, but certainly much better. All the best, DrJES

MariaDB [postoffice]> create index justuri on oc_cards(uri);
Query OK, 0 rows affected (0.248 sec)
Records: 0 Duplicates: 0 Warnings: 0

[root@POST postofficework]# time ./bin/create_user.sh macleajb3;time ./bin/delete_user.sh macleajb3
The user “macleajb3” was created successfully
Display name set to “macleajb3”

real 0m1.496s
user 0m1.233s
sys 0m0.156s
The specified user was deleted

real 0m1.947s
user 0m1.590s
sys 0m0.178s

MariaDB [postoffice]> drop index justuri on oc_cards;
Query OK, 0 rows affected (0.009 sec)
Records: 0 Duplicates: 0 Warnings: 0

[root@POST postofficework]# time ./bin/create_user.sh macleajb3;time ./bin/delete_user.sh macleajb3
The user “macleajb3” was created successfully
Display name set to “macleajb3”

real 0m5.314s
user 0m1.343s
sys 0m0.154s
The specified user was deleted

real 0m20.988s
user 0m1.161s
sys 0m0.127s

1 Like

I’m gonna try that. I have a client with 40 users and the user list is so slow to display and interact.