@@ -547,19 +547,23 @@ export class PgStore extends BasePgStore {
547
547
sat_coinbase_height = EXCLUDED.sat_coinbase_height,
548
548
updated_at = NOW()
549
549
` ;
550
- const pointers = await sql < DbLocationPointerInsert [ ] > `
551
- INSERT INTO locations ${ sql ( locationInserts ) }
552
- ON CONFLICT ON CONSTRAINT locations_inscription_id_block_height_tx_index_unique DO UPDATE SET
553
- genesis_id = EXCLUDED.genesis_id,
554
- block_hash = EXCLUDED.block_hash,
555
- tx_id = EXCLUDED.tx_id,
556
- address = EXCLUDED.address,
557
- value = EXCLUDED.value,
558
- output = EXCLUDED.output,
559
- "offset" = EXCLUDED.offset,
560
- timestamp = EXCLUDED.timestamp
561
- RETURNING inscription_id, id AS location_id, block_height, tx_index, address
562
- ` ;
550
+ const pointers : DbLocationPointerInsert [ ] = [ ] ;
551
+ for ( const batch of batchIterate ( locationInserts , 8000 ) )
552
+ pointers . push (
553
+ ...( await sql < DbLocationPointerInsert [ ] > `
554
+ INSERT INTO locations ${ sql ( batch ) }
555
+ ON CONFLICT ON CONSTRAINT locations_inscription_id_block_height_tx_index_unique DO UPDATE SET
556
+ genesis_id = EXCLUDED.genesis_id,
557
+ block_hash = EXCLUDED.block_hash,
558
+ tx_id = EXCLUDED.tx_id,
559
+ address = EXCLUDED.address,
560
+ value = EXCLUDED.value,
561
+ output = EXCLUDED.output,
562
+ "offset" = EXCLUDED.offset,
563
+ timestamp = EXCLUDED.timestamp
564
+ RETURNING inscription_id, id AS location_id, block_height, tx_index, address
565
+ ` )
566
+ ) ;
563
567
await this . updateInscriptionRecursions ( reveals ) ;
564
568
if ( transferredOrdinalNumbers . length )
565
569
await sql `
0 commit comments