I do a lot of database work with C3.
What I do is make the array a container and add two additional arrays - one called Filter, and one called Index. And I also add a dictionary so I can use field names instead of numbers for the columns.
The Filter array only has one column. If I want to show a subset of the records in the main array, Filter only contains the row number of the main array for records that meet my criteria.
Then to sort the array, I use the Index array. It has two columns - the first column contains the field (column from the main array) I want to sort by, the second column contains the row number from the main array.
To build the index, I loop through the Filter array so only records that match the current filter are included. For each row I copy the field I want to index by to the index array (and its row number). Sort the index array by the x-axis (and reverse if I want it in descending order).
I have used this with arrays that have thousands of records, and it works great - even on mobile! I can filter and sort a very large array instantly.