This PR removes the need to have a primary key defined within the database. For instance Clickhouse does not support it. So some specific code is needed. With this PR, such specific code could be removed and the same SQL queries could be used.
Also it appears that when running batches, the indexes are dropped and create again. But one index was not created as intended and included the created_at field. However with this PR, an index using the created_at field is necessary to keep good performance. So the initial index is updated (instead of updating the index in the batch method).
Context
This was initially part of #1094, and moved to another PR to avoid changing internal while integrating an experimental feature.
Changes
compute the user existence by count (and not by returning its id)
order the entries using the created_at field and not the id field
Purpose
This PR removes the need to have a primary key defined within the database. For instance Clickhouse does not support it. So some specific code is needed. With this PR, such specific code could be removed and the same SQL queries could be used.
Also it appears that when running batches, the indexes are dropped and create again. But one index was not created as intended and included the
created_at
field. However with this PR, an index using thecreated_at
field is necessary to keep good performance. So the initial index is updated (instead of updating the index in the batch method).Context
This was initially part of #1094, and moved to another PR to avoid changing internal while integrating an experimental feature.
Changes
created_at
field and not theid
fieldHow to test this PR