{"id":8396,"date":"2026-08-21T10:58:46","date_gmt":"2026-08-21T01:58:46","guid":{"rendered":"https:\/\/www.freelifemakers.org\/wordpress\/?p=8396"},"modified":"2026-08-21T13:53:51","modified_gmt":"2026-08-21T04:53:51","slug":"nextjssns-server-8","status":"publish","type":"post","link":"https:\/\/www.freelifemakers.org\/wordpress\/index.php\/2026\/08\/21\/nextjssns-server-8\/","title":{"rendered":"[nextjs]SNS Server-8(myapp18)"},"content":{"rendered":"\n<p>\ud83d\udc49\ud83c\udffb myapp18\uc5d0\uc11c\ub294 \uac1c\ubcc4\uae00 \ud655\uc778\uacfc \ud0c0\uc784\ub77c\uc778\uc744 \uad6c\ud604\ud569\ub2c8\ub2e4.<br>In myapp18, we implement the viewing of individual posts and the timeline.<\/p>\n\n\n\n<p>\ud83d\udc49\ud83c\udffb \ub370\uc774\ud130\ubca0\uc774\uc2a4 \uc131\ub2a5 \ud5a5\uc0c1\uc744 \uc704\ud574\uc11c \uc778\ub371\uc2a4\ub97c \ucd94\uac00\ud569\ub2c8\ub2e4.<br>Indexes are added to improve database performance.<\/p>\n\n\n\n<p>\ud83d\udcc1 \uc804\uccb4 \ud504\ub85c\uc81d\ud2b8 \uad6c\uc870 \/ Overall Project Structure<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>myapp18\/  \n\u251c\u2500\u2500 app\/  (Next.js App Router)\n\u2502   \u251c\u2500\u2500 .well-known\/webfinger\/route.ts  -&gt; webfinger\n\u2502   \u251c\u2500\u2500 api\/posts\/route.ts     -&gt; Writing API\n\u2502   \u251c\u2500\u2500 api\/follow\/route.ts    -&gt; Follow API(temporary)\n\u2502   \u251c\u2500\u2500 <strong>api\/timeline\/route.ts  -&gt; Timeline API<\/strong>\n\u2502   \u251c\u2500\u2500 users\/&#91;username]\/\n\u2502   \u2502   \u251c\u2500\u2500 <strong>statuses\/&#91;id]\/route.ts -&gt; Indivisual Post<\/strong>\n\u2502   \u2502   \u251c\u2500\u2500 route.ts               -&gt; Acotr Information\n\u2502   \u2502   \u251c\u2500\u2500 followers\/route.ts     -&gt; Followers List\n\u2502   \u2502   \u251c\u2500\u2500 following\/route.ts     -&gt; Following List\n\u2502   \u2502   \u251c\u2500\u2500 inbox\/route.ts         -&gt; Inbox\n\u2502   \u2502   \u2514\u2500\u2500 outbox\/route.ts        -&gt; outbox\n\u2502   \u251c\u2500\u2500 <strong>usersui\/&#91;username]\/page.tsx  -&gt; Timeline UI<\/strong>\n\u2502   \u251c\u2500\u2500 layout.tsx, page.tsx, globals.css\n\u2502   \u2514\u2500\u2500 favicon.ico\n\u251c\u2500\u2500 lib\/\n\u2502   \u251c\u2500\u2500 ap.ts                  -&gt; Follow Accept\n\u2502   \u2514\u2500\u2500 db.ts                  -&gt; DB connection\n\u251c\u2500\u2500 data\/\n\u2502   \u2514\u2500\u2500 keys\/                  -&gt; private.pem, public.pem\n\u251c\u2500\u2500 data.sqlite                -&gt; Database\n\u251c\u2500\u2500 Caddyfile                  -&gt; https \n\u2514\u2500\u2500 package.json<\/code><\/pre>\n\n\n\n<p>\ud83d\udcc1 \ud504\ub85c\uc81d\ud2b8 \uc2dc\uc791(myapp18)<br>Project Start (myapp18)<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>npx create-next-app@latest<\/code><\/pre>\n\n\n\n<p>\ud83d\udcc1 SQLite\uc124\uce58 \/ Installing SQLite<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>cd ~\/myapp18\nnpm install better-sqlite3\nnpm install -D @types\/better-sqlite3<\/code><\/pre>\n\n\n\n<p>\ud83d\udcc1 DDNS,https\uc124\uc815 \/ DDNS,https settings<\/p>\n\n\n\n<figure class=\"wp-block-embed is-type-wp-embed is-provider-freelifemakers-org wp-block-embed-freelifemakers-org\"><div class=\"wp-block-embed__wrapper\">\n<blockquote class=\"wp-embedded-content\" data-secret=\"QsXNz7Cxn6\"><a href=\"https:\/\/www.freelifemakers.org\/wordpress\/index.php\/2026\/08\/10\/nextjs-dns-caddy\/\">[nextjs]nextjs+domain(ddns)+https(caddy)<\/a><\/blockquote><iframe loading=\"lazy\" class=\"wp-embedded-content\" sandbox=\"allow-scripts\" security=\"restricted\" style=\"position: absolute; visibility: hidden;\" title=\"&#8220;[nextjs]nextjs+domain(ddns)+https(caddy)&#8221; &#8212; freelifemakers.org\" src=\"https:\/\/www.freelifemakers.org\/wordpress\/index.php\/2026\/08\/10\/nextjs-dns-caddy\/embed\/#?secret=Qw5B6R3bBZ#?secret=QsXNz7Cxn6\" data-secret=\"QsXNz7Cxn6\" width=\"560\" height=\"315\" frameborder=\"0\" marginwidth=\"0\" marginheight=\"0\" scrolling=\"no\"><\/iframe>\n<\/div><\/figure>\n\n\n\n<p>\ud83d\udcc1 \ub370\uc774\ud130\ubca0\uc774\uc2a4 \uc2a4\ud0a4\ub9c8 \ubcf4\uc644<br>Database schema supplementation<\/p>\n\n\n\n<p>\u2714\ufe0f \ub370\uc774\ud130 \ubca0\uc774\uc2a4 \ubd80\ubd84\uacfc \ucf54\ub4dc\ub97c \ubcf4\uc644\ud569\ub2c8\ub2e4.<br>I am refining the database components and the code.<\/p>\n\n\n\n<p>\u2714\ufe0f \uc778\ub371\uc2a4 \ucd94\uac00 \/ Add Index<\/p>\n\n\n\n<p>&#8212; \uc778\ub371\uc2a4\uc5d0 \ub300\ud55c \ucd94\uac00 \uc124\uba85\uc740 \uac00\uc7a5 \uc544\ub798 \ubd80\ubd84\uc758 \uc124\uba85\uc744 \ucc38\uc870 \ud558\uc138\uc694<br>Please refer to the explanation at the very bottom for additional details regarding the index.<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>-- 1. posts \ud0c0\uc784\ub77c\uc778\uc6a9 (\ud544\uc218) \/ Posts for timeline (Required)\nCREATE INDEX idx_posts_username_created ON posts(username, created_at DESC);\n\n-- 2. inbox_posts \ud0c0\uc784\ub77c\uc778\uc6a9 (\ud544\uc218) \/ inbox_posts for timeline (Required)\nCREATE INDEX idx_inbox_username_created ON inbox_posts(username, created_at DESC);\n\n-- 3. inbox_posts actor \uac80\uc0c9\uc6a9 (\uc120\ud0dd) \/ inbox_posts actor search term (optional)\nCREATE INDEX idx_inbox_actor ON inbox_posts(actor);<\/code><\/pre>\n\n\n\n<p>\u2714\ufe0f \uc778\ub371\uc2a4 \uc791\ub3d9 \ud655\uc778 \/ Verify index operation<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>sqlite&gt; EXPLAIN QUERY PLAN SELECT * FROM posts WHERE username='user1' ORDER BY created_at DESC;\nQUERY PLAN\n`--SEARCH posts <strong>USING INDEX idx_posts_username_created (username=?)<\/strong>\nsqlite&gt; EXPLAIN QUERY PLAN SELECT * FROM inbox_posts WHERE username='user1' ORDER BY created_at DESC;\nQUERY PLAN\n`--SEARCH inbox_posts<strong> USING INDEX idx_inbox_username_created (username=?)<\/strong>\nsqlite&gt; <\/code><\/pre>\n\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity\"\/>\n\n\n\n<p>\ud83d\udcc1 \uac1c\ubcc4\uae00 \ub77c\uc6b0\ud2b8 \/ Individual Post Route <\/p>\n\n\n\n<p>\u2714\ufe0f myapp18\/app\/users\/[username]\/statuses\/[id]\/route.ts <\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>\/\/ myapp18\u2705\/app\/users\/&#91;username]\/statuses\/&#91;id]\/route.ts\nimport db from '@\/lib\/db';\nimport { NextRequest, NextResponse } from 'next\/server';\n\nexport async function GET(\n  req: NextRequest,\n  { params }: { params: Promise&lt;{ username: string; id: string }&gt; }\n) {\n  const { username, id } = await params; \n  \n  \/\/ posts table\n  let post: any = db.prepare(\n    `SELECT * FROM posts WHERE id = ? AND username = ?`\n  ).get(id, username);\n\n  \/\/ inbox_posts table\n  if (!post) {\n    \/\/ inbox\ub294 id\uac00 \uc804\uccb4 URL\uc774\ub77c LIKE\ub85c \ucc3e\uae30\n    \/\/ inbox uses the full URL as id, so we search with LIKE\n    post = db.prepare(\n      `SELECT * FROM inbox_posts WHERE id LIKE ? AND username = ?`\n    ).get(`%${id}`, username);\n  }\n\n  if (!post) {\n    return new NextResponse('Not found', { status: 404 });\n  }\n\n  const base = process.env.NEXT_PUBLIC_BASE_URL || 'https:\/\/aloy-horizon.duckdns.org';\n  const url = `${base}\/users\/${username}\/statuses\/${id}`;\n\n  return NextResponse.json({\n    \"@context\": \"https:\/\/www.w3.org\/ns\/activitystreams\",\n    id: url,\n    type: \"Note\",\n    attributedTo: `${base}\/users\/${username}`,\n    content: post.content,\n    published: post.created_at,\n    to: &#91;\"https:\/\/www.w3.org\/ns\/activitystreams#Public\"],\n  });\n}<\/code><\/pre>\n\n\n\n<p>\ud83d\udcc1 \ud0c0\uc784\ub77c\uc778 API \/ Timeline API<\/p>\n\n\n\n<p>\u2714\ufe0f myapp18\/app\/api\/timeline\/route.ts<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>\/\/ app\/api\/timeline\/route.ts\n\/\/ myapp18\u2705\nimport db from '@\/lib\/db';\nimport { NextResponse } from 'next\/server';\n\nexport async function GET(req: Request) {\n  const { searchParams } = new URL(req.url);\n  const username = searchParams.get('username') || 'user1';\n\n  const timeline = db.prepare(`\n    SELECT id, content, username, created_at, 'mine' as source \n    FROM posts WHERE username = ?\n    UNION ALL\n    SELECT id, content, username, created_at, 'inbox' as source \n    FROM inbox_posts WHERE username = ?\n    ORDER BY created_at DESC\n    LIMIT 50\n  `).all(username, username);\n\n  return NextResponse.json(timeline);\n}\n<\/code><\/pre>\n\n\n\n<p>\ud83d\udcc1 \ud504\ub85c\ud544 UI\uc5d0\uc11c \ud0c0\uc784\ub77c\uc778 \ubd99\uc774\uae30<br>Adding a timeline to the profile UI<\/p>\n\n\n\n<p>\u2714\ufe0f myapp18\/app\/usersui\/[username]\/page.tsx<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>\/\/ app\/usersui\/&#91;username]\/page.tsx\nimport db from '@\/lib\/db';\n\nexport default async function Page({ params }: { params: Promise&lt;{ username: string }&gt; }) {\n  const { username } = await params;\n\n  \/\/ \ub3d9\uc77c\ud55c \ud14c\uc774\ube14\uc774\uae30 \ub54c\ubb38\uc5d0 \uc0ac\uc6a9\uac00\ub2a5 \n  \/\/ Same table, so it's available\n  const timeline = db.prepare(`\n    SELECT id, content, created_at, 'mine' as source FROM posts WHERE username=?\n    UNION ALL\n    SELECT id, content, created_at, 'inbox' as source FROM inbox_posts WHERE username=?\n    ORDER BY created_at DESC LIMIT 50\n  `).all(username, username) as any&#91;];\n\n  \/*\n  \/\/ UNION ALL\uc744 \uc4f0\uc9c0 \uc54a\uace0, \ub450 \ucffc\ub9ac\ub97c \ub530\ub85c \uc2e4\ud589\ud55c \ud6c4 \ud569\uce58\uace0 \uc815\ub82c\ud558\ub294 \ubc29\ubc95 \n  \/\/ You can also execute two queries separately and then merge and sort them without using UNION ALL\n  \n  const mine = db.prepare(`SELECT ... FROM posts ...`).all(username);\n  const inbox = db.prepare(`SELECT ... FROM inbox_posts ...`).all(username);\n  const timeline = &#91;...mine, ...inbox].sort(...)\n  *\/\n\n  return (\n    &lt;div style={{ padding: 20 }}&gt;\n      &lt;h1&gt;{username} \ud0c0\uc784\ub77c\uc778 \/ Timeline&lt;\/h1&gt;\n      &lt;ul&gt;\n        {timeline.map((p:any) =&gt; (\n          &lt;li key={p.id}&gt;&#91;{p.source}] {p.content} - {p.created_at}&lt;\/li&gt;\n        ))}\n      &lt;\/ul&gt;\n    &lt;\/div&gt;\n  );\n}\n<\/code><\/pre>\n\n\n\n<p>\ud83d\udcc1 \ud14c\uc2a4\ud2b8 \/ Test<\/p>\n\n\n\n<p>\u2714\ufe0f \uac1c\ubcc4 \uae00 \ub77c\uc6b0\ud130<\/p>\n\n\n\n<p>&#8212; \ub370\uc774\ud130\ubca0\uc774\uc2a4\uc758 username\uacfc id\uac00 \ud30c\ub77c\uba54\ud130\uac00 \ub429\ub2c8\ub2e4.<br>The database username and ID serve as parameters.<\/p>\n\n\n\n<p>&#8212; inbox_posts\ud14c\uc774\ube14\uc758 \uac1c\ubcc4\uae00\uc740 id\ub85c url\uc740 \uc81c\uc678\ud558\uace0 \ud574\uc2dc\uac12\ub9cc \uc785\ub825\ud569\ub2c8\ub2e4.<br>For individual posts in the <code>inbox_posts<\/code> table, only the hash value is entered\u2014excluding the URL\u2014based on the ID.<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code># posts table post\nhttps:\/\/aloy-horizon.duckdns.org\/users\/<strong>user1<\/strong>\/statuses\/<strong>aea0ec89-a368-44a9-8493-b2bd82a797a8<\/strong>\n\n{\n  \"@context\": \"https:\/\/www.w3.org\/ns\/activitystreams\",\n  \"id\": \"https:\/\/aloy-horizon.duckdns.org\/users\/user1\/statuses\/aea0ec89-a368-44a9-8493-b2bd82a797a8\",\n  \"type\": \"Note\",\n  \"attributedTo\": \"https:\/\/aloy-horizon.duckdns.org\/users\/user1\",\n  \"content\": \"post test! #test\",\n  \"published\": \"2026-08-11 12:08:18\",\n  \"to\": &#91;\n    \"https:\/\/www.w3.org\/ns\/activitystreams#Public\"\n  ]\n}\n\n# inbox_posts table post\nhttps:\/\/aloy-horizon.duckdns.org\/users\/<strong>user1<\/strong>\/statuses\/<strong>01M0EJPP57WC47FAK0N395S7MB<\/strong>\n\n{\n  \"@context\": \"https:\/\/www.w3.org\/ns\/activitystreams\",\n  \"id\": \"https:\/\/aloy-horizon.duckdns.org\/users\/user1\/statuses\/01M0EJPP57WC47FAK0N395S7MB\",\n  \"type\": \"Note\",\n  \"attributedTo\": \"https:\/\/aloy-horizon.duckdns.org\/users\/user1\",\n  \"content\": \"\\u003Cp\\u003Einbox_posts table test\\u003C\/p\\u003E\",\n  \"published\": \"2026-08-15 12:16:15\",\n  \"to\": &#91;\n    \"https:\/\/www.w3.org\/ns\/activitystreams#Public\"\n  ]\n}<\/code><\/pre>\n\n\n\n<p>\u2714\ufe0f \ud0c0\uc784\ub77c\uc778 API \/ TImeline API<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>https:\/\/aloy-horizon.duckdns.org\/api\/timeline?username=<strong>user1<\/strong><\/code><\/pre>\n\n\n\n<figure class=\"wp-block-image size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"800\" height=\"912\" src=\"https:\/\/www.freelifemakers.org\/wordpress\/wp-content\/uploads\/2026\/08\/myapp18-timeline-jpg.jpg\" alt=\"\" class=\"wp-image-8472\" srcset=\"https:\/\/www.freelifemakers.org\/wordpress\/wp-content\/uploads\/2026\/08\/myapp18-timeline-jpg.jpg 800w, https:\/\/www.freelifemakers.org\/wordpress\/wp-content\/uploads\/2026\/08\/myapp18-timeline-jpg-263x300.jpg 263w, https:\/\/www.freelifemakers.org\/wordpress\/wp-content\/uploads\/2026\/08\/myapp18-timeline-jpg-768x876.jpg 768w, https:\/\/www.freelifemakers.org\/wordpress\/wp-content\/uploads\/2026\/08\/myapp18-timeline-jpg-400x456.jpg 400w\" sizes=\"auto, (max-width: 800px) 100vw, 800px\" \/><figcaption class=\"wp-element-caption\">Timeline API<\/figcaption><\/figure>\n\n\n\n<p>\u2714\ufe0f \ud0c0\uc784\ub77c\uc778 UI \/ Timeline UI<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>https:\/\/aloy-horizon.duckdns.org\/usersui\/<strong>user1<\/strong><\/code><\/pre>\n\n\n\n<figure class=\"wp-block-image size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"800\" height=\"559\" src=\"https:\/\/www.freelifemakers.org\/wordpress\/wp-content\/uploads\/2026\/08\/myapp18-timeline-ui-jpg.jpg\" alt=\"\" class=\"wp-image-8473\" srcset=\"https:\/\/www.freelifemakers.org\/wordpress\/wp-content\/uploads\/2026\/08\/myapp18-timeline-ui-jpg.jpg 800w, https:\/\/www.freelifemakers.org\/wordpress\/wp-content\/uploads\/2026\/08\/myapp18-timeline-ui-jpg-300x210.jpg 300w, https:\/\/www.freelifemakers.org\/wordpress\/wp-content\/uploads\/2026\/08\/myapp18-timeline-ui-jpg-768x537.jpg 768w, https:\/\/www.freelifemakers.org\/wordpress\/wp-content\/uploads\/2026\/08\/myapp18-timeline-ui-jpg-400x280.jpg 400w\" sizes=\"auto, (max-width: 800px) 100vw, 800px\" \/><figcaption class=\"wp-element-caption\">TImeline UI<\/figcaption><\/figure>\n\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity\"\/>\n\n\n\n<p>\ud83d\udcc1 \uc778\ub371\uc2a4 \/ Index<\/p>\n\n\n\n<p>\u2714\ufe0f \uc778\ub371\uc2a4\ub294 \ub370\uc774\ud130\ubca0\uc774\uc2a4 \uac80\uc0c9\uc2dc \ube60\ub978 \uac80\uc0c9\uc744 \uc704\ud574\uc11c \uc0ac\uc6a9\ub429\ub2c8\ub2e4.<br>Indexes are used to enable fast searches when querying a database.<\/p>\n\n\n\n<p>\u2714\ufe0f sqlite\ub370\uc774\ud130\ubca0\uc774\uc2a4\uc5d0 \ub2e4\uc74c\uacfc \uac19\uc740 \uc778\ub371\uc2a4\ub97c \uc0ac\uc6a9\ud558\uace0 \uc788\uc2b5\ub2c8\ub2e4.<br>I am using the following index in the SQLite database.<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>CREATE INDEX idx_posts_username_published ON posts(username, published DESC);<\/code><\/pre>\n\n\n\n<p>&#8212; \uadf8\ub7ec\uba74 \uc544\ub798\uc640 \uac19\uc740 \uc0c1\ud669\uc5d0\uc11c \uc791\ub3d9\ud569\ub2c8\ub2e4.<br>Then, it operates in the following situation.<\/p>\n\n\n\n<p>&#8212; \uc55e\uc5d0\uc11c\ubd80\ud130 \uc21c\uc11c\ub300\ub85c \ub9de\uc73c\uba74 \uc791\ub3d9\ud569\ub2c8\ub2e4.<br>It operates if the conditions are met in the specified order, starting from the beginning.<br>(ON posts(username, published DESC))<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>-- username\ub9cc \uc788\uc5b4\ub3c4 \uc791\ub3d9\ud569\ub2c8\ub2e4.\nIt works with just the username.\n-- \ub77c\ubca8 \uc55e\ubd80\ubd84\uc73c\ub85c \ucc3e\uae30 \uac00\ub2a5 \ud569\ub2c8\ub2e4.\nYou can search using the front part of the label.\n\n<strong>WHERE username='user1'<\/strong>\n\n-- username + published \uc815\ub82c\uc740 \uc644\ubcbd\ud788 \uc791\ub3d9\ud569\ub2c8\ub2e4.\nSorting by username + published works perfectly.\n-- \ub77c\ubca8\uc774\ub791 100% \uc77c\uce58\ud558\ub294 \uacbd\uc6b0\uc774\uace0 \uc81c\uc77c \ube60\ub985\ub2c8\ub2e4.\nThis is the case where it matches the label 100%, and it is the fastest method.\n\n<strong>WHERE username='user1' ORDER BY published DESC<\/strong>\n\n-- username + published \uc870\uac74\ub3c4 \uc791\ub3d9\ud569\ub2c8\ub2e4.\nThe username + published condition also works.\n-- \uc55e+\ub4a4 \ub2e4 \uc0ac\uc6a9\ud558\ub294 \uacbd\uc6b0\uc785\ub2c8\ub2e4.\nThis is a case where both the front and back are used.\n\n<strong>WHERE username='user1' AND published &gt; '2026-05-10'<\/strong><\/code><\/pre>\n\n\n\n<p>&#8212; \ub2e4\uc74c\uacfc \uac19\uc774 username\uac19\uc774 \uc55e\ubd80\ubd84 \ubd80\ud130 \uc870\uac74\uc774 \ub9de\uc9c0 \uc54a\ub294 \uc870\uac74\uc740 \uc791\ub3d9\ud558\uc9c0 \uc54a\uc2b5\ub2c8\ub2e4.<br>Conditions that do not match from the beginning\u2014such as <code>username<\/code>\u2014will not work.<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>-- published\ub9cc \uac80\uc0c9\ud558\ub294 \uacbd\uc6b0 \uc785\ub2c8\ub2e4.\nThis applies when searching only for 'published' items.\n-- \ub77c\ubca8 \uc55e\uc774 username\uc778\ub370 username \uc870\uac74\uc774 \uc5c6\uae30 \ub584\ubb38\uc5d0 \uc778\ub371\uc2a4 \uac80\uc0c9\uc774 \uc791\ub3d9\ud558\uc9c0 \uc54a\uc2b5\ub2c8\ub2e4.\nThe `username` field appears at the beginning of the label, but since there is no condition specified for `username`, the index search does not work.\n\n<strong>WHERE published DESC<\/strong>\n\n\n-- content\ub85c \uac80\uc0c9\ud558\ub294 \uacbd\uc6b0\uc785\ub2c8\ub2e4.\nThis is the case when searching by content.\n-- \uc778\ub371\uc2a4\uc5d0 content \uc5c6\uc5b4\uc11c \uc778\ub371\uc2a4 \uac80\uc0c9\uc774 \uc791\ub3d9\ud558\uc9c0 \uc54a\uc2b5\ub2c8\ub2e4.\nIndex search is not working because the index lacks content.\n\n<strong>WHERE content='hello'<\/strong>\n<\/code><\/pre>\n\n\n\n<p>&#8212; sqlite\ub294 B-Tree\uad6c\uc870\ub85c \ub418\uc5b4 \uc788\uc2b5\ub2c8\ub2e4.<br>SQLite uses a B-Tree structure.<\/p>\n\n\n\n<p>&#8212; \ub098\ubb34\ucc98\ub7fc \ubfcc\ub9ac\uc5d0\uc11c \uac00\uc9c0,\uc78e\uacfc \uc720\uc0ac\ud55c \ud615\ud0dc\ub85c \uc810\uc810 \ubed7\uc5b4\ub098\uac00\uba74\uc11c \ub370\uc774\ud130 \uc778\ub371\uc2a4(\ub77c\ubca8)\uac00 \uc800\uc7a5\ub429\ub2c8\ub2e4.<br>A data index stores data indexes (labels) in a form similar to how a tree branches out into limbs and leaves.<\/p>\n\n\n\n<p>&#8212; \uc774\ub54c \uc78e\uc774\ub098 \uac00\uc9c0\uc5d0 \ud574\ub2f9\ud558\ub294 \uacf3\uc5d0 \ub77c\ubca8\ub85c \ub370\uc774\ud130\ubca0\uc774\uc2a4 \ud544\ub4dc\uc640 \ub0a0\uc9dc\ub97c \ub9ce\uc774 \uc0ac\uc6a9\ud569\ub2c8\ub2e4.<br>In this case, database fields and dates are frequently used as labels for the parts corresponding to leaves or branches.<\/p>\n\n\n\n<p>&#8212; \uc778\ub371\uc2a4\ub97c \uc0ac\uc6a9\ud558\uba74 \uac80\uc0c9\uc2dc \ub370\uc774\ud130 \uc804\uccb4 \uac80\uc0c9\uc744 \ud558\uc9c0 \uc54a\uc544\ub3c4 \ub429\ub2c8\ub2e4.<br>Using an index eliminates the need to scan the entire dataset during a search.<\/p>\n\n\n\n<p>&#8212; \uc778\ub371\uc2a4\uc5d0\uc11c \ub370\uc774\ud130\ubca0\uc774\uc2a4 \ud544\ub4dc\uc774\ub984\uc774\ub098 \ub0a0\uc9dc\uac00 \uac19\uc740 \ub77c\ubca8\uc5d0\uc11c\ub9cc \ucc3e\uc73c\uba74 \ub418\uae30\ub54c\ubb38\uc5d0 \uc18d\ub3c4\uac00 \ube60\ub985\ub2c8\ub2e4.<br>It is fast because the search within the index is limited to labels matching the database field name or date.<\/p>\n\n\n\n<blockquote class=\"wp-block-quote is-layout-flow wp-block-quote-is-layout-flow\">\n<p>\uc694\ud55c\ubcf5\uc74c 8\uc7a5 32\uc808 \/ John 8:32<\/p>\n\n\n\n<p>&#8220;\uadf8\ub9ac\uace0 \ub108\ud76c\ub294 \uc9c4\ub9ac\ub97c \uc54c\uac8c \ub420 \uac83\uc774\uba70, \uc9c4\ub9ac\uac00 \ub108\ud76c\ub97c \uc790\uc720\ub86d\uac8c \ud560 \uac83\uc774\ub2e4.&#8221;<\/p>\n\n\n\n<p>&#8220;Then you will know the truth ,and the truth will set you free&#8221;<\/p>\n<\/blockquote>\n","protected":false},"excerpt":{"rendered":"<p>\ud83d\udc49\ud83c\udffb myapp18\uc5d0\uc11c\ub294 \uac1c\ubcc4\uae00 \ud655\uc778\uacfc \ud0c0\uc784\ub77c\uc778\uc744 \uad6c\ud604\ud569\ub2c8\ub2e4.In myapp18, we implement the viewing of individual posts and the timeline. \ud83d\udc49\ud83c\udffb \ub370\uc774\ud130\ubca0\uc774\uc2a4 \uc131\ub2a5 \ud5a5\uc0c1\uc744 \uc704\ud574\uc11c \uc778\ub371\uc2a4\ub97c \ucd94\uac00\ud569\ub2c8\ub2e4.Indexes are added to improve database performance. \ud83d\udcc1 \uc804\uccb4 \ud504\ub85c\uc81d\ud2b8 \uad6c\uc870 \/ Overall Project Structure \ud83d\udcc1 \ud504\ub85c\uc81d\ud2b8 \uc2dc\uc791(myapp18)Project Start (myapp18) \ud83d\udcc1 SQLite\uc124\uce58 \/ Installing SQLite \ud83d\udcc1 DDNS,https\uc124\uc815 \/ DDNS,https settings \ud83d\udcc1 \ub370\uc774\ud130\ubca0\uc774\uc2a4 [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[28,27,1,7],"tags":[],"class_list":["post-8396","post","type-post","status-publish","format-standard","hentry","category-news","category-nextjs","category-uncategorized","category-website","missing-thumbnail"],"_links":{"self":[{"href":"https:\/\/www.freelifemakers.org\/wordpress\/index.php\/wp-json\/wp\/v2\/posts\/8396","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.freelifemakers.org\/wordpress\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.freelifemakers.org\/wordpress\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.freelifemakers.org\/wordpress\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.freelifemakers.org\/wordpress\/index.php\/wp-json\/wp\/v2\/comments?post=8396"}],"version-history":[{"count":78,"href":"https:\/\/www.freelifemakers.org\/wordpress\/index.php\/wp-json\/wp\/v2\/posts\/8396\/revisions"}],"predecessor-version":[{"id":8484,"href":"https:\/\/www.freelifemakers.org\/wordpress\/index.php\/wp-json\/wp\/v2\/posts\/8396\/revisions\/8484"}],"wp:attachment":[{"href":"https:\/\/www.freelifemakers.org\/wordpress\/index.php\/wp-json\/wp\/v2\/media?parent=8396"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.freelifemakers.org\/wordpress\/index.php\/wp-json\/wp\/v2\/categories?post=8396"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.freelifemakers.org\/wordpress\/index.php\/wp-json\/wp\/v2\/tags?post=8396"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}