{"id":2622,"date":"2019-01-24T09:23:23","date_gmt":"2019-01-24T00:23:23","guid":{"rendered":"http:\/\/daily.belltail.jp\/?p=2622"},"modified":"2019-01-28T19:49:46","modified_gmt":"2019-01-28T10:49:46","slug":"pythonpeewee-ormsqlite%e3%81%a71%e5%84%84%e3%83%ac%e3%82%b3%e3%83%bc%e3%83%89%e6%9c%80%e9%80%9finsert%e3%83%81%e3%83%a3%e3%83%ac%e3%83%b3%e3%82%b8","status":"publish","type":"post","link":"https:\/\/daily.belltail.jp\/?p=2622","title":{"rendered":"Python+Peewee ORM+SQLite\u30671\u5104\u30ec\u30b3\u30fc\u30c9\u6700\u901finsert\u30c1\u30e3\u30ec\u30f3\u30b8"},"content":{"rendered":"<p>\u30a4\u30ef\u30b7\u306e\u5927\u7fa4\u304c\u7279\u306b\u5927\u898f\u6a21\u306b\u306a\u3063\u305f\u3068\u304d\u3001\u305d\u308c\u3092<span class=\"st\">\u30b5\u30fc\u30c7\u30a3\u30f3\u30e9\u30f3\u3068\u547c\u3073\u3001\u500b\u4f53\u6570\u306f\u6570\u5343\u4e07\u3068\u3082\u6570\u5104\u3068\u3082\u6570\u5341\u5104\u3068\u3082\u3044\u308f\u308c\u308b\u306e\u3060\u305d\u3046\u3067\u3059\u3002\u305d\u306e\u3088\u3046\u306a\u751f\u7269\u91cf\u304c\u305d\u308c\u307b\u3069\u5bc6\u96c6\u3057\u305f\u3068\u304d<\/span><span class=\"st\">\u9178\u7d20\u6fc3\u5ea6\u306f\u8db3\u308a\u308b\u3093\u3060\u308d\u3046\u304b\u3068\u5fc3\u914d\u3067\u3059\u3002<\/span><\/p>\n<p>\u3055\u3066\u3001\u30c7\u30fc\u30bf\u51e6\u7406\u306e\u4e00\u74b0\u3067\u5104\u30aa\u30fc\u30c0\u30fc\u306e\u30ec\u30b3\u30fc\u30c9\u6570\uff08\u30c7\u30a3\u30b9\u30af\u4e0a\u3067~100GB\uff09\u3092\u3082\u3064SQLite\u30c6\u30fc\u30d6\u30eb\u3092\u69cb\u7bc9\u3057\u3088\u3046\u3068\u3044\u3046\u3053\u3068\u306b\u306a\u308a\u3001\u30c7\u30fc\u30bf\u81ea\u4f53\u306f\u751fCSV\u304c\u3042\u308b\u72b6\u614b\u3067\u3053\u308c\u3092\u306a\u308b\u3079\u304f\u77ed\u6642\u9593\u3067DB\u306b\u6d41\u3057\u8fbc\u3080\u3068\u3044\u3046\u96d1\u306a\u30c1\u30e3\u30ec\u30f3\u30b8\u3092\u3057\u3066\u307f\u305f\u306e\u3067\u3001\u96d1\u306a\u8a18\u9332\u3092\u307e\u3068\u3081\u3066\u304a\u304d\u307e\u3057\u305f\u3002<\/p>\n<p>\u3067\u304d\u308b\u3060\u3051Python\u3067\u9589\u3058\u3055\u305b\u305f\u304b\u3063\u305f\u305f\u3081\u3001C++\u306a\u3069\u3067\u66f8\u304f\u3068\u3044\u3046\u9078\u629e\u80a2\u306f\u306a\u3057\u3002<br \/>\n\u307e\u305fDB\u30b5\u30a4\u30ba\u304c\u30b5\u30a4\u30ba\u306a\u306e\u3067\u30a4\u30f3\u30e1\u30e2\u30ea\u3067\u306f\u306a\u304f\u30d5\u30a1\u30a4\u30eb\u306b\u5410\u304d\u51fa\u3057\u307e\u3059\u3002<br \/>\n\u307e\u305f\u30b9\u30ad\u30fc\u30de\u5b9a\u7fa9\u3092\u3055\u304f\u3063\u3068\u3084\u308a\u305f\u3044\u30fbDB\u69cb\u7bc9\u5f8c\u306e\u6271\u3044\u3092\u697d\u306b\u3057\u305f\u3044\u3068\u3044\u3046\u3053\u3068\u3067\u3001Python\u30d9\u30fc\u30b9\u306eORM <a href=\"http:\/\/docs.peewee-orm.com\/en\/latest\/\">Peewee<\/a>\u3092\u4f7f\u7528\u3059\u308b\u3053\u3068\u306b\u3057\u3066\u3044\u307e\u3059\u3002\u306a\u304aPeewee\u306b\u3064\u3044\u3066\u8a73\u7d30\u306f\u89e6\u308c\u306a\u3044\u3067\u3059\u304c\u3001\uff08\u30e6\u30fc\u30b6\u30d3\u30ea\u30c6\u30a3\u7684\u306a\u610f\u5473\u3067\uff09\u3068\u3066\u3082\u8efd\u91cf\u3067\u3042\u308a\u307e\u305fPythonic\u3067\u3042\u308b\u306e\u3067\u500b\u4eba\u7684\u306b\u306f\u3068\u3066\u3082\u597d\u304d\u3067\u3059\u3002select\u306ewhere\u306e\u6bd4\u8f03\u6f14\u7b97\u5b50\u3092\u6587\u5b57\u5217\u3067\u6e21\u3059\u3068\u304b\u3057\u306a\u304f\u3066\u3044\u3044\u306e\u3067\u3059\u3002<\/p>\n<p>DB\u95a2\u9023\u306f\u5168\u304f\u306e\u7d20\u4eba\u306a\u306e\u3067\u3001\u3082\u3063\u3068\u3044\u3044\u65b9\u6cd5\u304c\u3042\u3063\u305f\u3089\u305c\u3072\u30a2\u30c9\u30d0\u30a4\u30b9\u3092\u3044\u305f\u3060\u304d\u305f\u3044\u3067\u3059\u3002<\/p>\n<p>\u5b8c\u5168\u306a\u30b3\u30fc\u30c9\u3092Gist\u4e0a\u306eipynb\u306b\u307e\u3068\u3081\u3066\u3044\u307e\u3059\u3002<\/p>\n<p><script src=\"https:\/\/gist.github.com\/belltailjp\/482f329bfaa3a2a6141d8f1ed6e55522.js\"><\/script><\/p>\n<p><!--more--><\/p>\n<p>\u74b0\u5883\u6761\u4ef6<\/p>\n<ul>\n<li>OS: Ubuntu 18.04<\/li>\n<li>SQLite: 3.22.0 (Ubuntu\u30d1\u30c3\u30b1\u30fc\u30b8\u306e\u3082\u306e)<\/li>\n<li>Python: 3.7.1<\/li>\n<li>Peewee ORM: 3.8.1<\/li>\n<li>CPU: i7 8700K<\/li>\n<li>RAM: 16GB<\/li>\n<li>SSD: Crucial m4 512GB (SATAII)<\/li>\n<\/ul>\n<h1>\u30e2\u30c7\u30eb\uff08\u30c6\u30fc\u30d6\u30eb\uff09\u5b9a\u7fa9<\/h1>\n<p>\u30c6\u30b9\u30c8\u7528\u306b\u3001\u81ea\u5206\u306e\u30e6\u30fc\u30b9\u30b1\u30fc\u30b9\u306b\u4f3c\u3066\u3044\u3066\u30b7\u30f3\u30d7\u30eb\u5316\u3057\u305f\u30b9\u30ad\u30fc\u30de\u3092\u7528\u610f\u3057\u3066\u307f\u307e\u3057\u305f\u3002<\/p>\n<p>\u4e3b\u30ad\u30fc\u306e\u4ed6\u306b2\u3064\u306eIntegerField\u3092\u3082\u3064\u30e2\u30c7\u30eb\u3092\u5b9a\u7fa9\u3002 \u4e00\u65b9\u306f\u305d\u308c\u3089\u306e\u30ab\u30e9\u30e0\u305d\u308c\u305e\u308c\u306b\u5bfe\u3057\u3066\u30fb\u304a\u3088\u3073\u30da\u30a2\u3067\u30a4\u30f3\u30c7\u30af\u30b9\u3092\u5f35\u308b\u30e2\u30c7\u30eb\u3001\u3082\u3046\u4e00\u65b9\u306f\u30a4\u30f3\u30c7\u30af\u30b9\u3092\u5f35\u3089\u306a\u3044\u30e2\u30c7\u30eb\u3002<\/p>\n<pre class=\"brush: python; title: ; notranslate\" title=\"\">\r\nimport peewee\r\n\r\nfrom peewee import IntegerField\r\nfrom peewee import Model\r\nfrom peewee import SqliteDatabase\r\n\r\nfrom peewee import chunked\r\n\r\ndb = SqliteDatabase(None)\r\n\r\nclass NoIndexedTable(Model):\r\n    value_1 = IntegerField(unique=False)\r\n    value_2 = IntegerField(unique=False)\r\n    \r\n    class Meta:\r\n        database = db\r\n        \r\n    def __str__(self):\r\n        return &quot;{}-{}&quot;.format(self.value_1, self.value_2)\r\n        \r\nclass IndexedTable(Model):\r\n    value_1 = IntegerField(index=True, unique=False)\r\n    value_2 = IntegerField(index=True, unique=False)\r\n    \r\n    class Meta:\r\n        database = db\r\n        \r\n        indexes = (((&quot;value_1&quot;, &quot;value_2&quot;), True),)\r\n        \r\n    def __str__(self):\r\n        return &quot;{}-{}&quot;.format(self.value_1, self.value_2)\r\n<\/pre>\n<h2>DB\u521d\u671f\u5316<\/h2>\n<p>DB\u306f\u6700\u521d\u306b\u3053\u306e\u3088\u3046\u306b\u3057\u3066\u521d\u671f\u5316\u3002\u30c7\u30a3\u30b9\u30af\u540c\u671f\u306a\u3069\u306e\u30aa\u30fc\u30d0\u30d8\u30c3\u30c9\u3092\u53d6\u308a\u9664\u304f\u305f\u3081\u305d\u306e\u3088\u3046\u306a\u30aa\u30d7\u30b7\u30e7\u30f3\u3092\u4f7f\u7528\u3002<\/p>\n<pre class=\"brush: python; title: ; notranslate\" title=\"\">\r\nimport os\r\nos.remove('tmp.db')\r\ndb.init('tmp.db', pragmas={'synchronous': 0, 'journal_mode': 'memory'})\r\ndb.connect()\r\ndb.create_tables(&#x5B;NoIndexedTable, IndexedTable])\r\n<\/pre>\n<h2>\u5b9f\u9a13\u6761\u4ef6\u306e\u8a2d\u5b9a<\/h2>\n<p>1\u5104\u4ef6\u306einsert\u3092\u30d9\u30f3\u30c1\u30de\u30fc\u30af\u3002 SQLite\u3067\u306f1\u30af\u30a8\u30ea\u306b\u306f\u6700\u5927999\u5909\u6570\u307e\u3067\u542b\u3081\u3089\u308c\u3001\u5404\u30e2\u30c7\u30eb\u306e1\u30ec\u30b3\u30fc\u30c9\u306einsert\u306b2\u5909\u6570\u3092\u4fdd\u5b58\u3067\u304d\u308b\u305f\u3081\u30011\u30af\u30a8\u30ea\uff08\u30c1\u30e3\u30f3\u30af\uff09\u30b5\u30a4\u30ba\u306f\u6700\u5927\u3067499\u3067\u3042\u308b\u3002\u3053\u3053\u3067\u306f<code>chunk_size<\/code>\u3068\u3057\u3066400\u3092\u8a2d\u5b9a\u3002<\/p>\n<p>\u30ec\u30b3\u30fc\u30c9\u306e\u5404\u30ab\u30e9\u30e0\u306e\u5024\u3068\u3057\u3066\u30e9\u30f3\u30c0\u30e0\u5024\u3092\u7528\u3044\u3001\u305d\u306e\u6700\u5927\u5024\u3092<code>max_value<\/code>\u3068\u3059\u308b\u3002<\/p>\n<pre class=\"brush: python; title: ; notranslate\" title=\"\">\r\nN = 1000 * 1000 * 100\r\nchunk_size = 400\r\nmax_value = N ** 2\r\n<\/pre>\n<h1>(1) \u30d9\u30fc\u30b9\u30e9\u30a4\u30f3\uff1aPeewee ORM\u306e\u901a\u5e38\u306e\u30a4\u30f3\u30bf\u30d5\u30a7\u30fc\u30b9\u3067\u306e\u30d0\u30c3\u30c1insert<\/h1>\n<p>\u4e21\u65b9\u306e\u30e2\u30c7\u30eb\u306b\u30ec\u30b3\u30fc\u30c9\u3092N\u4ef6\u8ffd\u52a0\u3059\u308b\u30b3\u30fc\u30c9\u3002<\/p>\n<p>\u306a\u304a\u591a\u6570\u306e\u30ec\u30b3\u30fc\u30c9\u3092insert\u3057\u3088\u3046\u3068\u3059\u308b\u4eba\u304c\u30c8\u30e9\u30f3\u30b6\u30af\u30b7\u30e7\u30f3\u3092\u4f7f\u7528\u3057\u306a\u3044\u30fb\u30d0\u30c3\u30c1insert\u3092\u3057\u306a\u3044\u3001\u3068\u3044\u3046\u9078\u629e\u80a2\u306f\u3042\u308a\u3048\u306a\u3044\u305f\u3081\u3001\u305d\u308c\u3089\u306f\u6bd4\u8f03\u5bfe\u8c61\u306b\u3057\u306a\u3044\u3002<\/p>\n<p>\u5024\u306e\u751f\u6210\u65b9\u6cd5\u3068\u3057\u3066(1a)dict\u3067\u751f\u6210\u3059\u308b\u304b\u3001(1b)tuple\u3067\u751f\u6210\u3059\u308b\u304b\u3001\u3092<code>tpl<\/code>\u30aa\u30d7\u30b7\u30e7\u30f3\u3067\u6307\u5b9a\u3067\u304d\u308b\u3002<\/p>\n<pre class=\"brush: python; title: ; notranslate\" title=\"\">\r\ndef insert_records_peewee_standard_api(table, tpl=False):\r\n    with db.atomic(), tqdm(total=N) as pbar:\r\n        for _ in range(int(math.ceil(N \/ chunk_size))):\r\n            if tpl:\r\n                table.insert_many(&#x5B;(random.randint(0, max_value), random.randint(0, max_value))\r\n                                   for _ in range(chunk_size)],\r\n                                  fields=&#x5B;NoIndexedTable.value_1, NoIndexedTable.value_2]).execute()\r\n            else:\r\n                table.insert_many(&#x5B;{'value_1': random.randint(0, max_value),\r\n                                    'value_2': random.randint(0, max_value)}\r\n                                  for _ in range(chunk_size)]).execute()\r\n            pbar.update(chunk_size)\r\n    assert table.select().count() == N\r\n<\/pre>\n<table>\n<thead>\n<tr>\n<th>Table<\/th>\n<th>Method<\/th>\n<th>Wall Time<\/th>\n<th>Average speed<\/th>\n<\/tr>\n<\/thead>\n<tbody>\n<tr>\n<td>NoIndexed<\/td>\n<td>(1a) Baseline (dict)<\/td>\n<td>19min 18s<\/td>\n<td>86356 records\/s<\/td>\n<\/tr>\n<tr>\n<td>NoIndexed<\/td>\n<td>(1b) Baseline (tuple)<\/td>\n<td>18min 10s<\/td>\n<td>91743 records\/s<\/td>\n<\/tr>\n<tr>\n<td>Indexed<\/td>\n<td>(1a) Baseline (dict)<\/td>\n<td>54min 54s<\/td>\n<td>30358 records\/s<\/td>\n<\/tr>\n<tr>\n<td>Indexed<\/td>\n<td>(1b) Baseline (tuple)<\/td>\n<td>53min 56s<\/td>\n<td>30902 records\/s<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<h1>(2) \u30a4\u30f3\u30c7\u30af\u30b9\u3092\u4e00\u65e6\u7121\u52b9\u5316\u3057\u3066\u518d\u6709\u52b9\u5316<\/h1>\n<p>\u30a2\u30af\u30ed\u30d0\u30c6\u30a3\u30c3\u30af\u3067\u304b\u3064\u3042\u307e\u308a\u5b89\u5168\u3067\u306f\u306a\u3044\u65b9\u6cd5\u3002<\/p>\n<p>\u30a4\u30f3\u30c7\u30af\u30b9\u306e\u66f4\u65b0\u3092\u30ec\u30b3\u30fc\u30c9\u8ffd\u52a0\u306e\u305f\u3073\u306b\u884c\u3046\u306e\u306f\u30aa\u30fc\u30d0\u30d8\u30c3\u30c9\u304c\u5927\u304d\u3044\u305f\u3081\u3001\u4e00\u65e6\u30a4\u30f3\u30c7\u30af\u30b9\u3092\u524a\u9664\u3057\u305f\u72b6\u614b\u3067\u30ec\u30b3\u30fc\u30c9\u3092\u8ffd\u52a0\u3057\u305f\u4e0a\u3067\u30a4\u30f3\u30c7\u30af\u30b9\u3092\u5f35\u308a\u76f4\u3059\u3002\u307e\u3068\u3081\u3066\u30a4\u30f3\u30c7\u30af\u30b9\u3092\u518d\u69cb\u7bc9\u3057\u305f\u307b\u3046\u304c\u3001\u30ec\u30b3\u30fc\u30c9\u8ffd\u52a0\u306e\u305f\u3073\u306b\u66f4\u65b0\u3092\u884c\u3046\u3088\u308a\u52b9\u7387\u304c\u3044\u3044\u3068\u3044\u3046\u4eee\u8aac\u306b\u57fa\u3065\u304f\u65b9\u6cd5\u3002<\/p>\n<p>Peewee\u306e\u62e1\u5f35\u30e2\u30b8\u30e5\u30fc\u30ebplayhouse\u306b\u3042\u308bDB\u30de\u30a4\u30b0\u30ec\u30fc\u30b7\u30e7\u30f3API\u3092\u7528\u3044\u3066\u3001\u30a4\u30f3\u30c7\u30af\u30b9\u306e\u524a\u9664\u304a\u3088\u3073\u518d\u69cb\u7bc9\u3092\u884c\u3046\u3002<\/p>\n<p>\u203bDB\u3092\u30aa\u30f3\u30e9\u30a4\u30f3\u306b\u4fdd\u3063\u305f\u72b6\u614b\u3067\u3053\u308c\u3092\u3059\u308b\u306e\u306f\u5371\u967a\u3082\u3057\u304f\u306f\u52d5\u304b\u306a\u3044\u3002<\/p>\n<pre class=\"brush: python; title: ; notranslate\" title=\"\">\r\nfrom playhouse.migrate import SqliteMigrator, migrate\r\nmigrator = SqliteMigrator(db)\r\n\r\ndef drop_index_insert_remake_index():\r\n    table_name = IndexedTable._meta.table_name\r\n    with db.atomic():\r\n        migrate(\r\n            migrator.drop_index(table_name, table_name + '_value_1'),\r\n            migrator.drop_index(table_name, table_name + '_value_2'),\r\n            migrator.drop_index(table_name, table_name + '_value_1_value_2'),\r\n        )\r\n\r\n    insert_records_peewee_standard_api(IndexedTable, tpl=True)\r\n    \r\n    with db.atomic():\r\n        migrate(\r\n            migrator.add_index(table_name, ('value_1',), False),\r\n            migrator.add_index(table_name, ('value_2',), False),\r\n            migrator.add_index(table_name, ('value_1', 'value_2'), True),\r\n        )\r\n    assert IndexedTable.select().count() == N\r\n<\/pre>\n<table>\n<thead>\n<tr>\n<th>Table<\/th>\n<th>Method<\/th>\n<th>Wall Time<\/th>\n<th>Average speed<\/th>\n<\/tr>\n<\/thead>\n<tbody>\n<tr>\n<td>NoIndexed<\/td>\n<td>(1a) Baseline (dict)<\/td>\n<td>19min 18s<\/td>\n<td>86356 records\/s<\/td>\n<\/tr>\n<tr>\n<td>NoIndexed<\/td>\n<td>(1b) Baseline (tuple)<\/td>\n<td>18min 10s<\/td>\n<td>91743 records\/s<\/td>\n<\/tr>\n<tr>\n<td>Indexed<\/td>\n<td>(1a) Baseline (dict)<\/td>\n<td>54min 54s<\/td>\n<td>30358 records\/s<\/td>\n<\/tr>\n<tr>\n<td>Indexed<\/td>\n<td>(1b) Baseline (tuple)<\/td>\n<td>53min 56s<\/td>\n<td>30902 records\/s<\/td>\n<\/tr>\n<tr>\n<td><strong>Indexed<\/strong><\/td>\n<td><strong>(2) Drop index-&gt;insert-&gt;Reindex<\/strong><\/td>\n<td><strong>20min 45s<\/strong><\/td>\n<td><strong>80321 records\/s<\/strong><\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<p>\u30a4\u30f3\u30c7\u30af\u30b9\u306e\u3042\u308b\u30c6\u30fc\u30d6\u30eb\u306b\u5bfe\u3057\u3066\u300153\u520656\u79d2\u219220\u520645\u79d2\uff082.6\u500d\uff09\u9ad8\u901f\u5316\u3002<\/p>\n<h1>(3) SQL\u30af\u30a8\u30ea\u767a\u884c\u306e\u52b9\u7387\u5316<\/h1>\n<p>\u524d\u8ff0\u306e\u65b9\u6cd5\u3068\u306f\u76f4\u4ea4\u3059\u308b\u30a2\u30d7\u30ed\u30fc\u30c1\u3002<\/p>\n<p>\u6975\u7aef\u306b\u5927\u91cf\u306e\u30ec\u30b3\u30fc\u30c9\u3092\u4e00\u62ec\u3067\u633f\u5165\u3059\u308b\u5834\u5408\u3001ORM\u305d\u306e\u3082\u306e\u306e\u30aa\u30fc\u30d0\u30d8\u30c3\u30c9\u304c\u901f\u5ea6\u306e\u5236\u7d04\u3068\u306a\u308b\u53ef\u80fd\u6027\u304c\u3042\u308b\u3002\u305d\u3053\u3067\u3001ORM\u306e\u5404\u7a2e\u306e\u5229\u76ca\u3092\u4e00\u6642\u7684\u306b\u4eab\u53d7\u3067\u304d\u306a\u304f\u306a\u308b\u3053\u3068\u3092\u7406\u89e3\u3057\u305f\u4e0a\u3067\u3001\u30e2\u30c7\u30eb\u3092\u3059\u3063\u98db\u3070\u3057\u3066\u76f4\u63a5DB\u306binsert\u3059\u308b\u3002<\/p>\n<h2>(3-1) \u30e2\u30c7\u30eb\u3092\u7d4c\u7531\u305b\u305aSQLite\u3078\u306e\u30af\u30a8\u30ea\u3092\u76f4\u63a5Peewee\u304b\u3089\u5b9f\u884c<\/h2>\n<p>DB\u3078\u306e\u30b3\u30cd\u30af\u30b7\u30e7\u30f3\u3001\uff08\u30c6\u30fc\u30d6\u30eb\u304c\u5b58\u5728\u3057\u306a\u3044\u5834\u5408\u306e\uff09\u30c6\u30fc\u30d6\u30eb\u306e\u7528\u610f\u3084\u30c8\u30e9\u30f3\u30b6\u30af\u30b7\u30e7\u30f3\u306a\u3069\u306fPeewee\u306b\u4e57\u3063\u304b\u308c\u308b\u305f\u3081\u3001\u305d\u308c\u307b\u3069\u5927\u5909\u3067\u306f\u306a\u3044\u3002<\/p>\n<pre class=\"brush: python; title: ; notranslate\" title=\"\">\r\ndef insert_records_peewee_execute_sql(table):\r\n    with db.atomic():\r\n        query = 'insert into {}(value_1, value_2) values (?,?)'.format(table._meta.table_name)\r\n        for _ in tqdm(range(N)):\r\n            db.execute_sql(query, (random.randint(0, max_value), random.randint(0, max_value)))\r\n    assert table.select().count() == N\r\n<\/pre>\n<table>\n<thead>\n<tr>\n<th>Table<\/th>\n<th>Method<\/th>\n<th>Wall Time<\/th>\n<th>Average speed<\/th>\n<\/tr>\n<\/thead>\n<tbody>\n<tr>\n<td>NoIndexed<\/td>\n<td>(1a) Baseline (dict)<\/td>\n<td>19min 18s<\/td>\n<td>86356 records\/s<\/td>\n<\/tr>\n<tr>\n<td>NoIndexed<\/td>\n<td>(1b) Baseline (tuple)<\/td>\n<td>18min 10s<\/td>\n<td>91743 records\/s<\/td>\n<\/tr>\n<tr>\n<td>Indexed<\/td>\n<td>(1a) Baseline (dict)<\/td>\n<td>54min 54s<\/td>\n<td>30358 records\/s<\/td>\n<\/tr>\n<tr>\n<td>Indexed<\/td>\n<td>(1b) Baseline (tuple)<\/td>\n<td>53min 56s<\/td>\n<td>30902 records\/s<\/td>\n<\/tr>\n<tr>\n<td>Indexed<\/td>\n<td>(2) Drop index-&gt;insert-&gt;Reindex<\/td>\n<td>20min 45s<\/td>\n<td>80321 records\/s<\/td>\n<\/tr>\n<tr>\n<td><strong>NoIndexed<\/strong><\/td>\n<td><strong>(3-1) Raw SQL through ORM<\/strong><\/td>\n<td><strong>7min 23s<\/strong><\/td>\n<td><strong>225734 records\/s<\/strong><\/td>\n<\/tr>\n<tr>\n<td><strong>Indexed<\/strong><\/td>\n<td><strong>(3-1) Raw SQL through ORM<\/strong><\/td>\n<td><strong>39min 47s<\/strong><\/td>\n<td><strong>41893 records\/s<\/strong><\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<div class=\"inner_cell\">\n<div class=\"text_cell_render border-box-sizing rendered_html\">\n<p>(1)\u3067\u793a\u3057\u305f\u6a19\u6e96API\u3067\u8ffd\u52a0\u3059\u308b\u5834\u5408\u3067\u306f\u3001\u30a4\u30f3\u30c7\u30af\u30b9\u306a\u3057\u306718\u5206\u3001\u30a4\u30f3\u30c7\u30af\u30b9\u3042\u308a\u3067\u7d0454\u5206\u3067\u3042\u308a\u3001\u305d\u306e\u5dee\u306f\u7d0436\u5206\u3067\u3042\u3063\u305f\u3002 \u3053\u3053\u3067\u793a\u3057\u305f\u76f4\u63a5SQL\u5b9f\u884c\u3067\u306e\u30a4\u30f3\u30c7\u30af\u30b9\u306a\u3057\u3068\u3042\u308a\u306e\u5dee\u306f32\u5206\u3067\u3042\u3063\u305f\u3002 \u3053\u306e\u304a\u3088\u305d30\u5206\u5f37\u304c\u30a4\u30f3\u30c7\u30af\u30b9\u306e\u66f4\u65b0\u3067\u6d88\u8cbb\u3055\u308c\u3066\u3044\u308b\u3068\u8a00\u3048\u305d\u3046\u30021\u8981\u7d20\u3042\u305f\u308a\u306b\u306a\u3089\u3059\u306818\u30de\u30a4\u30af\u30ed\u79d2\u7a0b\u5ea6\u3067\u3042\u308b\u304c1\u5104\u4ef6insert\u3067\u306f\u7121\u8996\u3067\u304d\u306a\u3044\u3002<\/p>\n<\/div>\n<\/div>\n<h2>(3-2) Python\u306esqlite3\u3092\u76f4\u63a5\u53e9\u3044\u3066insert<\/h2>\n<p>\u4e0a\u8a18\u306e\u76f4\u63a5SQL\u767a\u884c\u3067\u306f1\u8981\u7d20\u305a\u3064\u30af\u30a8\u30ea\u3092\u767a\u884c\u3057\u3066\u3044\u305f\u3002\u3053\u308c\u306f\u73fe\u5728\u306ePeewee\u306eAPI\u306e\u5236\u7d04\u306b\u3088\u308b\u3082\u306e\u3067\u3042\u308b\u304c\u3001SQLite\u305d\u308c\u81ea\u4f53\u306f\u8907\u6570\u30ec\u30b3\u30fc\u30c9\u3092\u4e00\u5ea6\u306binsert\u3067\u304d\u308b\u3002<\/p>\n<p>\u306a\u304a\u3053\u306e\u3068\u304dPeewee\u3067\u958b\u3044\u305fDB\u306f\u4e00\u65e6\u9589\u3058\u308b\u5fc5\u8981\u304c\u3042\u308b\u3002<\/p>\n<pre class=\"brush: python; title: ; notranslate\" title=\"\">\r\nimport sqlite3\r\n\r\ndef insert_records_direct_sqlite(table):\r\n    con = sqlite3.connect(&quot;tmp.db&quot;)\r\n    c = con.cursor()\r\n    query = &quot;insert into {}(value_1, value_2) values (?,?)&quot;.format(table._meta.table_name)\r\n    c.executemany(query, &#x5B;(random.randint(0, max_value), random.randint(0, max_value))\r\n                          for _ in tqdm(range(N))])\r\n    con.commit()\r\n    con.close()\r\n<\/pre>\n<table>\n<thead>\n<tr>\n<th>Table<\/th>\n<th>Method<\/th>\n<th>Wall Time<\/th>\n<th>Average speed<\/th>\n<\/tr>\n<\/thead>\n<tbody>\n<tr>\n<td>NoIndexed<\/td>\n<td>(1a) Baseline (dict)<\/td>\n<td>19min 18s<\/td>\n<td>86356 records\/s<\/td>\n<\/tr>\n<tr>\n<td>NoIndexed<\/td>\n<td>(1b) Baseline (tuple)<\/td>\n<td>18min 10s<\/td>\n<td>91743 records\/s<\/td>\n<\/tr>\n<tr>\n<td>Indexed<\/td>\n<td>(1a) Baseline (dict)<\/td>\n<td>54min 54s<\/td>\n<td>30358 records\/s<\/td>\n<\/tr>\n<tr>\n<td>Indexed<\/td>\n<td>(1b) Baseline (tuple)<\/td>\n<td>53min 56s<\/td>\n<td>30902 records\/s<\/td>\n<\/tr>\n<tr>\n<td>Indexed<\/td>\n<td>(2) Drop index-&gt;insert-&gt;Reindex<\/td>\n<td>20min 45s<\/td>\n<td>80321 records\/s<\/td>\n<\/tr>\n<tr>\n<td>NoIndexed<\/td>\n<td>(3-1) Raw SQL through ORM<\/td>\n<td>7min 23s<\/td>\n<td>225734 records\/s<\/td>\n<\/tr>\n<tr>\n<td>Indexed<\/td>\n<td>(3-1) Raw SQL through ORM<\/td>\n<td>39min 47s<\/td>\n<td>41893 records\/s<\/td>\n<\/tr>\n<tr>\n<td><strong>NoIndexed<\/strong><\/td>\n<td><strong>(3-2) Direct SQLite<\/strong><\/td>\n<td><strong>4min 2s<\/strong><\/td>\n<td><strong>413223 records\/s<\/strong><\/td>\n<\/tr>\n<tr>\n<td><strong>Indexed<\/strong><\/td>\n<td><strong>(3-2) Raw SQL through ORM<\/strong><\/td>\n<td><strong>53min 23s<\/strong><\/td>\n<td><strong>31221 records\/s<\/strong><\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<p>\u30a4\u30f3\u30c7\u30af\u30b9\u306e\u306a\u3044\u30c6\u30fc\u30d6\u30eb\u306e\u5834\u5408\u306f\u3001execute_sql\u3092\u547c\u3076\u5834\u5408\u306b\u6bd4\u3079\u3066\u3055\u3089\u306b\u5927\u5e45\u306b\u9ad8\u901f\u5316\uff087\u520623\u79d2\u21924\u52062\u79d2\u3001\u5dee\u306f\u7d043\u5206\u5f37\uff09\u3002<\/p>\n<p>\u5f53\u7136\u3001\u30a4\u30f3\u30c7\u30af\u30b9\u306e\u3042\u308b\u30c6\u30fc\u30d6\u30eb\u306e\u5834\u5408\u306f\u5168\u304f\u6069\u6075\u306b\u4e0e\u308c\u306a\u3044\uff08\u30dc\u30c8\u30eb\u30cd\u30c3\u30af\u306fSQL\u767a\u884c\u3067\u306f\u306a\u3044\u305f\u3081\uff09\u3002<\/p>\n<h1>(4) \u3053\u308c\u3089\u306e\u30c6\u30af\u30cb\u30c3\u30af\u3092\u7d44\u307f\u5408\u308f\u305b\u308b<\/h1>\n<p>(2)\u3067\u793a\u3057\u305f\u3088\u3046\u306b\u3001\u30a4\u30f3\u30c7\u30af\u30b9\u3092\u4e00\u65e6\u524a\u9664\u3057\u30ec\u30b3\u30fc\u30c9\u3092\u8ffd\u52a0\u3057\u305f\u4e0a\u3067\u30a4\u30f3\u30c7\u30af\u30b9\u518d\u69cb\u7bc9\u3059\u308b\u3053\u3068\u304c\uff08\u5b89\u5168\u6027\u3068\u5f15\u304d\u63db\u3048\u306b\uff09\u30d1\u30d5\u30a9\u30fc\u30de\u30f3\u30b9\u4e0a\u6709\u52b9\u3002<\/p>\n<p>\u307e\u305f(3)\u3067\u793a\u3057\u305f\u3088\u3046\u306b\u3001ORM\u3092\u3059\u3063\u3068\u3070\u3057\u3066\u30ec\u30b3\u30fc\u30c9\u3092\u8ffd\u52a0\u3059\u308b\u3053\u3068\u304c\u30d1\u30d5\u30a9\u30fc\u30de\u30f3\u30b9\u4e0a\u6709\u52b9\u3002<\/p>\n<p>\u3053\u308c\u3089\u3092\u7d44\u307f\u5408\u308f\u305b\u3066\u6700\u901finsert\u3092\u76ee\u6307\u3059\u3002<\/p>\n<h2>Peewee\u306b\u304a\u3051\u308b\u6c4e\u7528\u7684\u306aindex\u306e\u524a\u9664\u30fb\u518d\u69cb\u7bc9\u30b3\u30fc\u30c9<\/h2>\n<p>index\u540d\u3092\u624b\u6253\u3061\u3057\u3066Peewee\u306e\u30de\u30a4\u30b0\u30ec\u30fc\u30bf\u306b\u6295\u3052\u308b\u306e\u306f\u80fd\u7387\u304c\u60aa\u3044\u306e\u3067\u3001\u3053\u308c\u3092\u81ea\u52d5\u5316\u3059\u308b\u3002<\/p>\n<pre class=\"brush: python; title: ; notranslate\" title=\"\">\r\nfrom playhouse.migrate import SqliteMigrator, migrate\r\n\r\nclass drop_and_recreate_index:\r\n    def __init__(self, table):\r\n        self.table = table\r\n        self.table_name = table._meta.table_name\r\n        self.migrator = SqliteMigrator(table._meta.database)\r\n        \r\n        self.indexed_columns = &#x5B;(name, col.unique)\r\n                                for name, col in self.table._meta.columns.items()\r\n                                if col.index]\r\n        \r\n        # &#x5B;(('value_1', 'value_2'), True), ...]\r\n        self.multi_column_indexes = self.table._meta.indexes\r\n\r\n    def drop_index(self):\r\n        with self.table._meta.database.atomic():\r\n            # Drop column indexes\r\n            for name, _ in self.indexed_columns:\r\n                idx_name = self.table_name + '_' + name\r\n                migrate(migrator.drop_index(self.table_name, idx_name))\r\n                \r\n            # Drop multi-column indexes\r\n            for columns, _ in self.multi_column_indexes:\r\n                idx_name = &quot;_&quot;.join(&#x5B;self.table_name] + list(columns))\r\n                migrate(migrator.drop_index(self.table_name, idx_name))\r\n\r\n    def recreate_index(self):\r\n        with self.table._meta.database.atomic():\r\n            # Recreate column indexes\r\n            for name, unique in self.indexed_columns:\r\n                migrate(migrator.add_index(self.table_name, (name,), unique))\r\n            \r\n            # Recreate multi-column indexes\r\n            for (columns, unique) in self.multi_column_indexes:\r\n                migrate(migrator.add_index(self.table_name, columns, unique))\r\n\r\n    def __enter__(self):\r\n        self.drop_index()\r\n    \r\n    def __exit__(self, exception_type, exception_value, traceback):\r\n        self.recreate_index()\r\n<\/pre>\n<p>\u3053\u306e\u3088\u3046\u306a\u30b3\u30fc\u30c9\u3067\u3001\u4e0b\u8a18\u306e\u3088\u3046\u306b\u4f7f\u3048\u308b\u3002<\/p>\n<pre class=\"brush: python; title: ; notranslate\" title=\"\">\r\nwith drop_and_recreate_index(TableName):\r\n    # insert records to DB\r\n<\/pre>\n<p>\u306a\u304a\u9014\u4e2d\u3067\u5931\u6557\u3057\u305f\u5834\u5408\u306b\u30a4\u30f3\u30c7\u30af\u30b9\u304c\u306a\u3044\u72b6\u614b\u306e\u307e\u307eDB\u304c\u6b8b\u308b\u5371\u967a\u304c\u3042\u308b\u3053\u3068\u306a\u3069\u5b9f\u88c5\u3068\u3057\u3066\u306f\u5341\u5206\u5b89\u5168\u306b\u8a70\u3081\u3089\u308c\u3066\u3044\u306a\u3044\u306e\u3067\u5b9f\u969b\u306b\u4f7f\u3046\u5834\u5408\u306f\u6ce8\u610f\u3055\u308c\u305f\u3044\u3002<\/p>\n<h2>(4-1) execute_sql + index drop\/rebuild\u3067\u306e\u30ec\u30b3\u30fc\u30c9\u633f\u5165<\/h2>\n<p>\u4e0a\u3067\u5b9a\u7fa9\u6e08\u307f\u306e<code>insert_records_peewee_execute_sql<\/code>\u3092\u518d\u5229\u7528\u3002<\/p>\n<pre class=\"brush: python; title: ; notranslate\" title=\"\">\r\ndef insert_records_peewee_execute_sql_drop_index():\r\n    with drop_and_recreate_index(IndexedTable):\r\n        insert_records_peewee_execute_sql(IndexedTable)\r\n    assert IndexedTable.select().count() == N\r\n<\/pre>\n<h2>(4-2) sqlite3\u76f4\u53e9\u304d + index drop\/rebuild\u3067\u306e\u30ec\u30b3\u30fc\u30c9\u633f\u5165<\/h2>\n<pre class=\"brush: python; title: ; notranslate\" title=\"\">\r\ndef insert_records_direct_sqlite_drop_index():\r\n    with drop_and_recreate_index(IndexedTable):\r\n        insert_records_direct_sqlite(IndexedTable)\r\n    assert IndexedTable.select().count() == N\r\n<\/pre>\n<table>\n<thead>\n<tr>\n<th>Table<\/th>\n<th>Method<\/th>\n<th>Wall Time<\/th>\n<th>Average speed<\/th>\n<\/tr>\n<\/thead>\n<tbody>\n<tr>\n<td>NoIndexed<\/td>\n<td>(1a) Baseline (dict)<\/td>\n<td>19min 18s<\/td>\n<td>86356 records\/s<\/td>\n<\/tr>\n<tr>\n<td>NoIndexed<\/td>\n<td>(1b) Baseline (tuple)<\/td>\n<td>18min 10s<\/td>\n<td>91743 records\/s<\/td>\n<\/tr>\n<tr>\n<td>Indexed<\/td>\n<td>(1a) Baseline (dict)<\/td>\n<td>54min 54s<\/td>\n<td>30358 records\/s<\/td>\n<\/tr>\n<tr>\n<td>Indexed<\/td>\n<td>(1b) Baseline (tuple)<\/td>\n<td>53min 56s<\/td>\n<td>30902 records\/s<\/td>\n<\/tr>\n<tr>\n<td>Indexed<\/td>\n<td>(2) Drop index-&gt;insert-&gt;Reindex<\/td>\n<td>20min 45s<\/td>\n<td>80321 records\/s<\/td>\n<\/tr>\n<tr>\n<td>NoIndexed<\/td>\n<td>(3-1) Raw SQL through ORM<\/td>\n<td>7min 23s<\/td>\n<td>225734 records\/s<\/td>\n<\/tr>\n<tr>\n<td>Indexed<\/td>\n<td>(3-1) Raw SQL through ORM<\/td>\n<td>39min 47s<\/td>\n<td>41893 records\/s<\/td>\n<\/tr>\n<tr>\n<td>NoIndexed<\/td>\n<td>(3-2) Direct SQLite<\/td>\n<td>4min 2s<\/td>\n<td>413223 records\/s<\/td>\n<\/tr>\n<tr>\n<td>Indexed<\/td>\n<td>(3-2) Raw SQL through ORM<\/td>\n<td>53min 23s<\/td>\n<td>31221 records\/s<\/td>\n<\/tr>\n<tr>\n<td><strong>Indexed<\/strong><\/td>\n<td><strong>(4-1) (2)+(3-1)<\/strong><\/td>\n<td><strong>9min 57s<\/strong><\/td>\n<td><strong>167504 records\/s<\/strong><\/td>\n<\/tr>\n<tr>\n<td><strong>Indexed<\/strong><\/td>\n<td><strong>(4-2) (2)+(3-2)<\/strong><\/td>\n<td><strong>6min 33s<\/strong><\/td>\n<td><strong>254453 records\/s<\/strong><\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<p>\u30a4\u30f3\u30c7\u30af\u30b9\u3092\u3082\u3064\u30e2\u30c7\u30eb\u3067\u30821\u5104\u4ef6\u306einsert\u30926\u520633\u79d2\u3067\u5b8c\u4e86\uff08\u30a4\u30f3\u30c7\u30af\u30b9\u7834\u68c4\u30fb\u518d\u69cb\u7bc9\u306e\u6642\u9593\u3092\u5168\u3066\u542b\u3080\uff09\u3001\u5e73\u5747\u3057\u3066254000\u30ec\u30b3\u30fc\u30c9\u6bce\u79d2\u3092\u9054\u6210\u3002\u901a\u5e38\u306e\u30d0\u30c3\u30c1\uff0b\u30c8\u30e9\u30f3\u30b6\u30af\u30b7\u30e7\u30f3\u3067\u306einsert\u3067\u306f3.1\u4e07\u30ec\u30b3\u30fc\u30c9\u6bce\u79d2\u304c\u6700\u901f\u3067\u3042\u3063\u305f\u306e\u3067\u30018\u500d\u4ee5\u4e0a\u306e\u9ad8\u901f\u5316\u3092\u9054\u6210\u3002<\/p>\n<p>\u30a4\u30f3\u30c7\u30af\u30b9\u3092\u3082\u305f\u306a\u3044\u30e2\u30c7\u30eb\u306e\u5834\u5408\u3067\u3082\u30019.2\u4e07\u30ec\u30b3\u30fc\u30c9\u6bce\u79d2\u3067\u3042\u3063\u305f\u3082\u306e\u304c41\u4e07\u30ec\u30b3\u30fc\u30c9\u6bce\u79d2\u30684\u500d\u4ee5\u4e0a\u306e\u9ad8\u901f\u5316\u3002<\/p>\n<p>ORM\u306f\u3082\u3061\u308d\u3093\u67d4\u8edf\u6027\u3084\u5b89\u5168\u6027\u3092\u62c5\u4fdd\u3059\u308b\u305f\u3081\u306b\u5fc5\u8981\u306a\u5404\u7a2e\u306e\u4ed5\u7d44\u307f\u306e\u305f\u3081\u306b\u7d30\u304b\u306a\u30aa\u30fc\u30d0\u30d8\u30c3\u30c9\u304c\u751f\u3058\u3066\u3044\u308b\u304c\u3001DB\u304c\u58ca\u308c\u308b\u30ea\u30b9\u30af\u3092\u627f\u77e5\u306e\u4e0a\u3001\u307e\u305f\u633f\u5165\u3059\u308b\u5024\u304c\u30a2\u30d7\u30ea\u30b1\u30fc\u30b7\u30e7\u30f3\u30ed\u30b8\u30c3\u30af\u4e0a\u6b63\u5f53\u3067\u3042\u308b\u3053\u3068\u304c\u78ba\u5b9f\u3067\u3042\u308b\u5834\u5408\u3067\u3042\u308a\u304b\u3064\u6975\u7aef\u306b\u591a\u6570\u306einsert\u3092\u884c\u3046\u5834\u5408\u306b\u3064\u3044\u3066\u306f\u3001\u3053\u308c\u3089\u306e\u30c6\u30af\u30cb\u30c3\u30af\u304c\u6709\u52b9\u3002<\/p>\n<p>\u30a4\u30f3\u30c7\u30af\u30b9\u304c\u3042\u307e\u308a\u591a\u304f\u5f35\u3089\u308c\u3066\u3044\u306a\u3044\u5834\u5408\u306f\u3001\u3053\u306e\u3088\u3046\u306a\u5371\u967a\u3092\u304a\u304b\u3059\u5fc5\u8981\u306f\u901a\u5e38\u306a\u3044\u3067\u3059\u3002<\/p>\n<hr \/>\n<p>\u3053\u308c\u3067\u5b9f\u969b\u306e\u81ea\u5206\u306e\u4f8b\u3067\u3082\uff08\u3082\u3046\u5c11\u3057\u8907\u96d1\u306a\u30b9\u30ad\u30fc\u30de\u306e\uff09DB\u306b\u7d042\u5104\u4ef6\u7a0b\u5ea6\u306e\u30ec\u30b3\u30fc\u30c9\u3092\u6b63\u54731\u6642\u9593\u4ee5\u4e0b\u3067insert\u3067\u304d\u308b\u3088\u3046\u306b\u306a\u308a\u307e\u3057\u305f\u3002\u81ea\u5206\u306e\u30e6\u30fc\u30b9\u30b1\u30fc\u30b9\u3067\u306f\u305d\u306e\u6642\u70b9\u3067SQLite\u30dc\u30c8\u30eb\u30cd\u30c3\u30af\u3067\u306f\u306a\u304f\u306a\u3063\u305f\u306e\u3067\u3001\u3082\u3046\u6df1\u8ffd\u3044\u3057\u306a\u304f\u3066\u826f\u3055\u305d\u3046\uff08SQLite\u306e\u30d3\u30eb\u30c9\u30aa\u30d7\u30b7\u30e7\u30f3\uff08\u30b9\u30ec\u30c3\u30c9\u30bb\u30fc\u30d5\u5468\u308a\u3068\u304b\uff09\u3067\u307e\u3060\u5371\u967a\u3092\u627f\u77e5\u3067\u901f\u304f\u3059\u308b\u4f59\u5730\u306f\u3042\u308a\u305d\u3046\u3067\u3059\uff09\u3002<\/p>\n<p>Peewee ORM\u3092\u4f7f\u3044\u307e\u3059\u3068\u8a00\u3044\u306a\u304c\u3089\u3001\u6700\u7d42\u7684\u306bPeewee\u3092\u4ecb\u3055\u306a\u3044\u306e\u304c\u4e00\u756a\u901f\u304b\u3063\u305f\u3067\u3059\u306d\u3068\u3044\u3046\u5143\u3082\u5b50\u3082\u306a\u3044\u7d50\u679c\u306b\u3002\u540c\u3058\u4f5c\u8005\u3055\u3093\u306e[https:\/\/github.com\/coleifer\/sweepea:title=Sweepea]\u3068\u3044\u3046\u306e\u3082\u3042\u308a\u307e\u3059\u304c\u8a66\u3057\u3066\u3044\u307e\u305b\u3093\u3002\u305f\u3076\u3093C++\u306b\u3057\u305f\u3089\u3055\u3089\u306b\u901f\u304f\u306a\u308b\uff08\u3084\u3089\u306a\u3044\u3088\uff01\u305c\u3063\u305f\u3044\u3084\u3089\u306a\u3044\u3088\uff01\uff09<\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u30a4\u30ef\u30b7\u306e\u5927\u7fa4\u304c\u7279\u306b\u5927\u898f\u6a21\u306b\u306a\u3063\u305f\u3068\u304d\u3001\u305d\u308c\u3092\u30b5\u30fc\u30c7\u30a3\u30f3\u30e9\u30f3\u3068\u547c\u3073\u3001\u500b\u4f53\u6570\u306f\u6570\u5343\u4e07\u3068\u3082\u6570\u5104\u3068\u3082\u6570\u5341\u5104\u3068\u3082\u3044\u308f\u308c\u308b\u306e\u3060\u305d\u3046\u3067\u3059\u3002\u305d\u306e\u3088\u3046\u306a\u751f\u7269\u91cf\u304c\u305d\u308c\u307b\u3069\u5bc6\u96c6\u3057\u305f\u3068\u304d\u9178\u7d20\u6fc3\u5ea6\u306f\u8db3\u308a\u308b\u3093\u3060\u308d\u3046\u304b\u3068\u5fc3\u914d\u3067\u3059\u3002 \u3055\u3066\u3001\u30c7\u30fc\u30bf\u51e6\u7406\u306e [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[],"class_list":["post-2622","post","type-post","status-publish","format-standard","hentry","category-1"],"_links":{"self":[{"href":"https:\/\/daily.belltail.jp\/index.php?rest_route=\/wp\/v2\/posts\/2622","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/daily.belltail.jp\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/daily.belltail.jp\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/daily.belltail.jp\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/daily.belltail.jp\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=2622"}],"version-history":[{"count":21,"href":"https:\/\/daily.belltail.jp\/index.php?rest_route=\/wp\/v2\/posts\/2622\/revisions"}],"predecessor-version":[{"id":2650,"href":"https:\/\/daily.belltail.jp\/index.php?rest_route=\/wp\/v2\/posts\/2622\/revisions\/2650"}],"wp:attachment":[{"href":"https:\/\/daily.belltail.jp\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=2622"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/daily.belltail.jp\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=2622"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/daily.belltail.jp\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=2622"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}