Questions tagged [bulkupdate]

Bulk update a database

Methods to bulk update a database with single or multiple columns of data. This could be either unique data for each row or same data for a column.

299 questions
34
votes
9 answers

How to Bulk Update records in Entity Framework?

I am trying to bulk update records using Entity Framework. I have tried Entity Framework.Extensions Update method. The Update method is able to bulk update for a set of records with same set of update values. Example: Id - …
Ujjwal27
  • 1,103
  • 3
  • 15
  • 31
13
votes
5 answers

Bulk update via raw query in TypeORM

How can I do bulk update via raw query in TypeORM? For example we have model User with property name How can I change names of few users in one transaction? typeorm version: 0.2.7 database: postgress
Max
  • 853
  • 1
  • 10
  • 18
12
votes
2 answers

Most efficient way to do a bulk UPDATE with pairs of input

Suppose I want to do a bulk update, setting a=b for a collection of a values. This can easily be done with a sequence of UPDATE queries: UPDATE foo SET value='foo' WHERE id=1 UPDATE foo SET value='bar' WHERE id=2 UPDATE foo SET value='baz' WHERE…
Jonathan Hall
  • 75,165
  • 16
  • 143
  • 189
7
votes
1 answer

How to `update_all` based on a subquery in Rails

I'm trying to achieve something pretty simple in PostgreSQL the Rails way. Say you have a User model with 3 columns id, cached_segment, cached_step. Say you already have a complex query that calculates segment and query on the fly, encapsulated in a…
Matthieu Libeer
  • 2,286
  • 1
  • 12
  • 16
7
votes
2 answers

Table Valued Constructor Maximum rows limit in Select

I have a Table Valued Constructor through which am Selecting around 1 million records. It will be used to update another table. SELECT * FROM (VALUES (100,200,300), (100,200,300), (100,200,300), …
Pரதீப்
  • 91,748
  • 19
  • 131
  • 172
7
votes
1 answer

Sqlite3 Python: How to do an efficient bulk update?

I can do very efficient bulk inserts in Sqlite3 on Python (2.7) with this code: cur.executemany("INSERT INTO " + tableName + " VALUES (?, ?, ?, ?);", data) But I can't get updates to work efficiently. I thought it might be a problem of the database…
LunaiThi
  • 111
  • 1
  • 8
6
votes
1 answer

Spring Data Mongodb - How to do Bulk Upsert

I have a list of objects/domains of same Collection that should be inserted if not present in Mongodb database, otherwise it should update an existing records filter by _id. Although this can be done using Spring data MongoRepositories, but it seem…
Afridi
  • 6,753
  • 2
  • 18
  • 27
6
votes
0 answers

Are MongoDB bulk updates atomic if they apply to the same document?

For the following command where query can only ever match one document (note that bulkWrite() is ordered by default): final BulkWriteResult res = db.getCollection("mycol").bulkWrite(Arrays.asList( new UpdateOneModel<>(query, new…
elhefe
  • 3,404
  • 3
  • 31
  • 45
6
votes
1 answer

Sqlalchemy bulk update in MySQL works very slow

I'm using SQLAlchemy 1.0.0, and want to make some UPDATE ONLY (update if match primary key else do nothing) queries in batch. I've made some experiment and found that bulk update looks much slower than bulk insert or bulk upsert. Could you please…
twds
  • 333
  • 1
  • 4
  • 15
5
votes
2 answers

Update auto_now field in bulk_update

I'm using Django 2.2 and I have a model with auto_now modification_datetime field and I need to update it during/after a bulk_update execution only for the affected registries that were really updated. Is it possible to update auto_now datetime…
JBarrioGarcía
  • 165
  • 2
  • 11
5
votes
2 answers

Sequelize bulkCreate updateOnDuplicate for postgresQL?

I know there is no support for updateOnDuplicate for postgresQL by Sequelize sequelize doc, so is there a work around for this? Can it be implemented via "SQL command".
4
votes
0 answers

Mongodb 4.0 bulkWrite is extremely slow while updating

I have a collection with more than 1 million user, I'm trying to update users balance on some event. while I'm trying to update e.g. 299 row it takes up to 15739.901ms no high load on the sever, it's just mongo running. I'm storing the database on…
Jennifer
  • 603
  • 1
  • 7
  • 17
4
votes
1 answer

Invalid index exception when using BulkExecutor in CosmosDb

I have an error when I'm trying to use BulkExecutor to update one of the properties in CosmosDb. The error message is "Index was out of range. Must be non-negative and less than the size of the collection. Parameter name: index" Important point- I…
Maxim Alexeyev
  • 1,021
  • 11
  • 24
4
votes
1 answer

Mongo Bulk Updates - which succeeded (matched and modified) and which did not?

In order to improve the performance of many single Mongo document updates @Node, I consider using Mongo's Bulk operation - to update as many as 1000 documents at each iteration. In this use case, each individual update opeartion may or may not…
davidhadas
  • 2,333
  • 21
  • 17
3
votes
1 answer

SqlBulkTools - Update

When I try to run, I get this error: System.Data.SqlClient.SqlException: 'The definition for column 'Column' must include a data type but I defined the types of variables in the 'business' class public void import (String TXT_T_NEG, String…
1
2 3
19 20