@@ -205,8 +205,6 @@ def build_clock_table(entity_table: sa.Table,
205
205
entity_keys = set ()
206
206
for fk in util .foreign_key_to (entity_table , nullable = False ):
207
207
# this is done to support arbitrary primary key shape on entity
208
- # We don't add additional indices on the foreign keys here because
209
- # the uniqueness constraints will add an implicit index.
210
208
clock_table .append_column (fk )
211
209
entity_keys .add (fk .key )
212
210
@@ -276,11 +274,7 @@ def _exclusion_in(type_, name) -> typing.Tuple:
276
274
277
275
278
276
@_exclusion_in .register (sap .UUID )
279
- def _exclusion_in_uuid (type_ , name ):
280
- """
281
- Cast UUIDs to text for our exclusion index because postgres doesn't
282
- currently allow GiST indices on UUIDs.
283
- """
277
+ def _ (type_ , name ):
284
278
return sa .cast (sa .text (name ), sap .TEXT ), '='
285
279
286
280
@@ -298,9 +292,7 @@ def build_history_table(
298
292
table_name = util .truncate_identifier (
299
293
_generate_history_table_name (local_table , columns )
300
294
)
301
- # Build the foreign key(s), specifically adding an index since we may use
302
- # a casted foreign key in our constraints. See _exclusion_in_uuid
303
- entity_foreign_keys = list (util .foreign_key_to (local_table , index = True ))
295
+ entity_foreign_keys = list (util .foreign_key_to (local_table ))
304
296
entity_constraints = [
305
297
_exclusion_in (fk .type , fk .key )
306
298
for fk in entity_foreign_keys
0 commit comments