---
title: "Efficient Bulk Hash Insertion with Redis 8.10’s HIMPORT"
url: https://daily.dev/posts/efficient-bulk-hash-insertion-with-redis-8-10-s-himport-jc43cvrqt
source_url: https://redis.io/blog/efficient-bulk-hash-insertion-with-redis-810s-himport
type: article
source: "Redis"
published: 2026-08-25T06:50:48.969Z
updated: 2026-08-25T06:51:16.680Z
tags: ["performance", "backend", "ruby", "redis"]
reading_time: 4
upvotes: 0
comments: 0
language: en
---

> ## Documentation Index
> Fetch the complete documentation index at: https://daily.dev/llms.txt
> Use this file to discover all available pages before exploring further.

# Efficient Bulk Hash Insertion with Redis 8.10’s HIMPORT

**[Redis](https://daily.dev/sources/redislabs)** · 4 min read · 0 upvotes · 0 comments

## Summary

Redis 8.10 introduces a new command called HIMPORT designed for efficient bulk insertion of hash data, avoiding the repeated transmission of field names required by HSET. Using the redis-rb Ruby client, the guide walks through preparing a field set with HIMPORT PREPARE, bulk-loading data with HIMPORT SET inside a pipeline, and discarding the field set afterward. A benchmark of one million records with three fields shows HIMPORT completing 11% faster than HSET, with larger gains expected for wider field sets due to bandwidth savings. Full demo source code is available on GitHub.

## Full article

daily.dev links to this article rather than hosting it. Read it at the original source: <https://redis.io/blog/efficient-bulk-hash-insertion-with-redis-810s-himport>

## Questions this post answers

### What is the Redis HIMPORT command and how is it different from HSET?

HIMPORT is a Redis command introduced for bulk hash insertion that avoids repeatedly sending field names with every write, unlike HSET. It works via sub-commands: HIMPORT PREPARE declares a named field set once, HIMPORT SET inserts records referencing that field set, and HIMPORT DISCARD removes it. This saves network bandwidth, especially with larger field sets.

_Track new Redis commands like this one as you plan data-import performance work, via daily.dev._

### How much faster is HIMPORT than HSET for bulk inserts in Redis?

In a benchmark inserting one million records with a three-field hash, HIMPORT completed in 10.589 seconds versus 12.029 seconds for HSET, an 11% improvement. The gain comes from not resending field names on every call, so wider field sets are expected to show even larger improvements since more bandwidth is saved per record.

_Compare benchmark results like these before choosing a bulk-insert strategy in Redis, on daily.dev._

### Do I need to re-prepare a HIMPORT field set after a Redis connection reconnects?

No, if himport_auto_prepare is set to true (the default) in the redis-rb client, the library maintains an internal registry of prepared field sets and automatically re-registers them after a reconnect. For pipelined bulk imports on a single connection, himport_auto_prepare can instead be set to false and the field set prepared explicitly within the pipeline.

_Keep track of client-library defaults like this one when adopting new Redis features, with daily.dev._

## Similar posts on daily.dev

- [Redis 8.8 performance improvements: Faster string, hash, streams, SCAN & more](https://daily.dev/posts/redis-8-8-performance-improvements-faster-string-hash-streams-scan-more-r1i57y9jy) · Redis · 2 upvotes · 0 comments
- [Redis 8.8: New array data structure & open source features](https://daily.dev/posts/redis-8-8-new-array-data-structure-open-source-features-hbi5ralxf) · Redis · 1 upvotes · 0 comments

---

Tags: [#performance](https://daily.dev/tags/performance), [#backend](https://daily.dev/tags/backend), [#ruby](https://daily.dev/tags/ruby), [#redis](https://daily.dev/tags/redis)

[View this post on daily.dev](https://daily.dev/posts/efficient-bulk-hash-insertion-with-redis-8-10-s-himport-jc43cvrqt)
