From 5c99ad3905326762c2fa3a2f3c57aa8429faaf2d Mon Sep 17 00:00:00 2001 From: Alex Garcia Date: Fri, 11 Oct 2024 09:08:29 -0700 Subject: [PATCH] nbc demo updates --- examples/nbc-headlines/2_build.ipynb | 68 +- examples/nbc-headlines/3_search.ipynb | 38 +- examples/nbc-headlines/bench.sql | 26 - examples/nbc-headlines/build.sql | 45 -- examples/nbc-headlines/hybrid.ipynb | 897 -------------------------- examples/nbc-headlines/query.sql | 57 -- 6 files changed, 19 insertions(+), 1112 deletions(-) delete mode 100644 examples/nbc-headlines/bench.sql delete mode 100644 examples/nbc-headlines/build.sql delete mode 100644 examples/nbc-headlines/hybrid.ipynb delete mode 100644 examples/nbc-headlines/query.sql diff --git a/examples/nbc-headlines/2_build.ipynb b/examples/nbc-headlines/2_build.ipynb index 44b3ac5..cece195 100644 --- a/examples/nbc-headlines/2_build.ipynb +++ b/examples/nbc-headlines/2_build.ipynb @@ -21,11 +21,7 @@ { "cell_type": "code", "execution_count": 1, - "metadata": { - "vscode": { - "languageId": "sql" - } - }, + "metadata": {}, "outputs": [ { "data": { @@ -55,11 +51,7 @@ { "cell_type": "code", "execution_count": 3, - "metadata": { - "vscode": { - "languageId": "sql" - } - }, + "metadata": {}, "outputs": [ { "data": { @@ -117,11 +109,7 @@ { "cell_type": "code", "execution_count": 25, - "metadata": { - "vscode": { - "languageId": "sql" - } - }, + "metadata": {}, "outputs": [ { "data": { @@ -205,11 +193,7 @@ { "cell_type": "code", "execution_count": 6, - "metadata": { - "vscode": { - "languageId": "sql" - } - }, + "metadata": {}, "outputs": [ { "data": { @@ -261,11 +245,7 @@ { "cell_type": "code", "execution_count": 9, - "metadata": { - "vscode": { - "languageId": "sql" - } - }, + "metadata": {}, "outputs": [ { "data": { @@ -319,11 +299,7 @@ { "cell_type": "code", "execution_count": 27, - "metadata": { - "vscode": { - "languageId": "sql" - } - }, + "metadata": {}, "outputs": [ { "data": { @@ -484,11 +460,7 @@ { "cell_type": "code", "execution_count": 15, - "metadata": { - "vscode": { - "languageId": "sql" - } - }, + "metadata": {}, "outputs": [ { "data": { @@ -530,11 +502,7 @@ { "cell_type": "code", "execution_count": 16, - "metadata": { - "vscode": { - "languageId": "sql" - } - }, + "metadata": {}, "outputs": [ { "data": { @@ -579,11 +547,7 @@ { "cell_type": "code", "execution_count": 21, - "metadata": { - "vscode": { - "languageId": "sql" - } - }, + "metadata": {}, "outputs": [ { "data": { @@ -635,11 +599,7 @@ { "cell_type": "code", "execution_count": 22, - "metadata": { - "vscode": { - "languageId": "sql" - } - }, + "metadata": {}, "outputs": [ { "data": { @@ -683,11 +643,7 @@ { "cell_type": "code", "execution_count": 28, - "metadata": { - "vscode": { - "languageId": "sql" - } - }, + "metadata": {}, "outputs": [ { "data": { @@ -843,7 +799,7 @@ "language_info": { "file_extension": ".sql", "mimetype": "text/x.sqlite", - "name": "sqlite", + "name": "sql", "nb_converter": "script", "pygments_lexer": "sql", "version": "TODO" diff --git a/examples/nbc-headlines/3_search.ipynb b/examples/nbc-headlines/3_search.ipynb index 9294e94..f19c139 100644 --- a/examples/nbc-headlines/3_search.ipynb +++ b/examples/nbc-headlines/3_search.ipynb @@ -17,11 +17,7 @@ { "cell_type": "code", "execution_count": 1, - "metadata": { - "vscode": { - "languageId": "sql" - } - }, + "metadata": {}, "outputs": [ { "data": { @@ -95,11 +91,7 @@ { "cell_type": "code", "execution_count": 19, - "metadata": { - "vscode": { - "languageId": "sql" - } - }, + "metadata": {}, "outputs": [ { "data": { @@ -196,11 +188,7 @@ { "cell_type": "code", "execution_count": 6, - "metadata": { - "vscode": { - "languageId": "sql" - } - }, + "metadata": {}, "outputs": [ { "data": { @@ -397,11 +385,7 @@ { "cell_type": "code", "execution_count": 11, - "metadata": { - "vscode": { - "languageId": "sql" - } - }, + "metadata": {}, "outputs": [ { "data": { @@ -833,11 +817,7 @@ { "cell_type": "code", "execution_count": 14, - "metadata": { - "vscode": { - "languageId": "sql" - } - }, + "metadata": {}, "outputs": [ { "data": { @@ -1396,11 +1376,7 @@ { "cell_type": "code", "execution_count": 18, - "metadata": { - "vscode": { - "languageId": "sql" - } - }, + "metadata": {}, "outputs": [ { "data": { @@ -1664,7 +1640,7 @@ "language_info": { "file_extension": ".sql", "mimetype": "text/x.sqlite", - "name": "sqlite", + "name": "sql", "nb_converter": "script", "pygments_lexer": "sql", "version": "TODO" diff --git a/examples/nbc-headlines/bench.sql b/examples/nbc-headlines/bench.sql deleted file mode 100644 index 6f9781d..0000000 --- a/examples/nbc-headlines/bench.sql +++ /dev/null @@ -1,26 +0,0 @@ -.open tmp.db ---.load ./vec0 -.load ./lembed0 -.timer on - -insert into lembed_models(name, model) - values ( - 'default', - lembed_model_from_file('all-MiniLM-L6-v2.e4ce9877.q8_0.gguf') - ); - -with subset as ( - select headline from articles limit 1000 -) -select sum(lembed(headline)) from subset; - - -.load ./rembed0 - -insert into rembed_clients(name, options) - values ('default','llamafile'); - -with subset as ( - select headline from articles limit 1000 -) -select sum(rembed('default', headline)) from subset; diff --git a/examples/nbc-headlines/build.sql b/examples/nbc-headlines/build.sql deleted file mode 100644 index 626b111..0000000 --- a/examples/nbc-headlines/build.sql +++ /dev/null @@ -1,45 +0,0 @@ -.mode box -.header on -.bail on - -begin; - -create virtual table fts_headlines using fts5( - headline, - content='articles', content_rowid='id' -); - -insert into fts_headlines(rowid, headline) - select rowid, headline - from articles; - -INSERT INTO fts_headlines(fts_headlines) VALUES('optimize'); - -.timer on - -.load ../../dist/vec0 -.load ./lembed0 - -insert into lembed_models(name, model) values - ('default', lembed_model_from_file('all-MiniLM-L6-v2.e4ce9877.q8_0.gguf')); - -create virtual table vec_headlines using vec0( - article_id integer primary key, - headline_embedding float[384] -); - --- 1m23s -insert into vec_headlines(article_id, headline_embedding) -select - rowid, - lembed(headline) -from articles; -commit; - - --- rembed vec0 INSERT: 10m17s --- before: 4.37 MB --- /w fts content: 5.35 MB (+0.98 MB) --- with optimize 5.30 MB (-0.049 MB) --- w/ fts: 6.67 MB (+2.30 MB) --- sum(octet_length(headline)): 1.16 MB diff --git a/examples/nbc-headlines/hybrid.ipynb b/examples/nbc-headlines/hybrid.ipynb deleted file mode 100644 index ac4e79d..0000000 --- a/examples/nbc-headlines/hybrid.ipynb +++ /dev/null @@ -1,897 +0,0 @@ -{ - "cells": [ - { - "cell_type": "code", - "execution_count": 1, - "metadata": { - "vscode": { - "languageId": "sql" - } - }, - "outputs": [ - { - "data": { - "text/plain": [ - "[no code]" - ] - }, - "execution_count": 1, - "metadata": {}, - "output_type": "execute_result" - } - ], - "source": [ - ".open tmp.db\n", - ".load ../../dist/vec0\n", - ".load ./rembed0\n", - "\n", - "insert into rembed_clients(name, options)\n", - " values ('snowflake-arctic-embed-m-v1.5', 'llamafile');\n", - "\n", - "--select vec_version(), rembed_debug();" - ] - }, - { - "cell_type": "markdown", - "metadata": {}, - "source": [ - "## FTS Search" - ] - }, - { - "cell_type": "code", - "execution_count": 10, - "metadata": { - "vscode": { - "languageId": "sql" - } - }, - "outputs": [ - { - "data": { - "text/html": [ - "
\n", - "\n", - "\n", - "\n", - "\n", - "\n", - "\n", - "\n", - "\n", - "\n", - "\n", - "\n", - "\n", - "\n", - "\n", - "\n", - "\n", - "\n", - "\n", - "\n", - "\n", - "
\n", - "rowid\n", - "\n", - "headline_highlighted\n", - "\n", - "rank\n", - "
\n", - "4666\n", - "\n", - "Kamala Harris visits <b>Planned</b> <b>Parenthood</b> clinic\n", - "\n", - "-18.9139950477264\n", - "
\n", - "6521\n", - "\n", - "Former Marine sentenced to 9 years in prison for firebombing <b>Planned</b> <b>Parenthood</b> clinic\n", - "\n", - "-14.807022703838651\n", - "
\n", - "
\n", - "2 rows × 3 columns\n", - "
\n", - "
\n" - ], - "text/plain": [ - "\u001b[0m┌\u001b[0m\u001b[0m───────\u001b[0m\u001b[0m┬\u001b[0m\u001b[0m──────────────────────────────────────────────────────────────────────────────────────────────────────\u001b[0m\u001b[0m┬\u001b[0m\u001b[0m─────────────────────\u001b[0m\u001b[0m┐\n", - "\u001b[0m\u001b[0m\u001b[0m│\u001b[0m\u001b[0m \u001b[0m\u001b[0m\u001b[0mrowid\u001b[0m \u001b[0m\u001b[0m│\u001b[0m\u001b[0m \u001b[0m\u001b[0m\u001b[0mheadline_highlighted \u001b[0m \u001b[0m\u001b[0m│\u001b[0m\u001b[0m \u001b[0m\u001b[0m\u001b[0mrank \u001b[0m \u001b[0m\u001b[0m│\u001b[0m\u001b[0m\n", - "\u001b[0m\u001b[0m\u001b[0m├\u001b[0m\u001b[0m───────\u001b[0m\u001b[0m┼\u001b[0m\u001b[0m──────────────────────────────────────────────────────────────────────────────────────────────────────\u001b[0m\u001b[0m┼\u001b[0m\u001b[0m─────────────────────\u001b[0m\u001b[0m┤\n", - "\u001b[0m\u001b[0m\u001b[0m│\u001b[0m\u001b[0m \u001b[0m\u001b[0m\u001b[0m 4666\u001b[0m \u001b[0m\u001b[0m│\u001b[0m\u001b[0m \u001b[0m\u001b[0m\u001b[0mKamala Harris visits Planned Parenthood clinic \u001b[0m \u001b[0m\u001b[0m│\u001b[0m\u001b[0m \u001b[0m\u001b[0m\u001b[0m -18.9139950477264\u001b[0m \u001b[0m\u001b[0m│\u001b[0m\u001b[0m\n", - "\u001b[0m\u001b[0m\u001b[0m│\u001b[0m\u001b[0m \u001b[0m\u001b[0m\u001b[0m 6521\u001b[0m \u001b[0m\u001b[0m│\u001b[0m\u001b[0m \u001b[0m\u001b[0m\u001b[0mFormer Marine sentenced to 9 years in prison for firebombing Planned Parenthood clinic\u001b[0m \u001b[0m\u001b[0m│\u001b[0m\u001b[0m \u001b[0m\u001b[0m\u001b[0m-14.807022703838651\u001b[0m \u001b[0m\u001b[0m│\u001b[0m\u001b[0m\n", - "\u001b[0m\u001b[0m\u001b[0m└\u001b[0m\u001b[0m───────\u001b[0m\u001b[0m┴\u001b[0m\u001b[0m──────────────────────────────────────────────────────────────────────────────────────────────────────\u001b[0m\u001b[0m┴\u001b[0m\u001b[0m─────────────────────\u001b[0m\u001b[0m┘\n", - "\u001b[0m\u001b[0m" - ] - }, - "execution_count": 10, - "metadata": {}, - "output_type": "execute_result" - } - ], - "source": [ - ".param set query planned parenthood\n", - "\n", - "select\n", - " rowid,\n", - " highlight(fts_headlines, 0, '', '') as headline_highlighted,\n", - " rank\n", - "from fts_headlines\n", - "where headline match :query\n", - "order by rank\n", - "limit 10;" - ] - }, - { - "cell_type": "markdown", - "metadata": {}, - "source": [ - "## Vector Search" - ] - }, - { - "cell_type": "code", - "execution_count": 11, - "metadata": { - "vscode": { - "languageId": "sql" - } - }, - "outputs": [ - { - "ename": "SQL logic error", - "evalue": "Error sending HTTP request: http://localhost:8080/embedding: Connection Failed: Connect error: Connection refused (os error 61)", - "output_type": "error", - "traceback": [] - } - ], - "source": [ - ".param set query planned parenthood\n", - "\n", - "select\n", - " article_id,\n", - " articles.headline,\n", - " distance\n", - "from vec_headlines\n", - "left join articles on articles.rowid = vec_headlines.article_id\n", - "where headline_embedding match vec_normalize(vec_slice(rembed('snowflake-arctic-embed-m-v1.5', :query), 0, 256))\n", - " and k = 10;" - ] - }, - { - "cell_type": "markdown", - "metadata": {}, - "source": [ - "## FTS + Vector search: RFF" - ] - }, - { - "cell_type": "code", - "execution_count": 13, - "metadata": { - "vscode": { - "languageId": "sql" - } - }, - "outputs": [ - { - "ename": "SQL logic error", - "evalue": "SQL logic error (1) : Error sending HTTP request: http://localhost:8080/embedding: Connection Failed: Connect error: Connection refused (os error 61)", - "output_type": "error", - "traceback": [] - } - ], - "source": [ - ".param set query planned parenthood\n", - "\n", - "insert or replace into temp.sqlite_parameters\n", - " values ('query_embedding', rembed('snowflake-arctic-embed-m-v1.5', :query));\n", - "\n", - ".param set weight_fts 1.0\n", - ".param set weight_vec 1.0\n", - ".param set rrf_k 60\n", - ".param set k 10\n", - "\n", - "\n", - "with vec_matches as (\n", - " select\n", - " article_id,\n", - " row_number() over (order by distance) as rank_number,\n", - " distance\n", - " from vec_headlines\n", - " where\n", - " headline_embedding match vec_slice(:query_embedding, 0, 256)\n", - " and k = :k\n", - " order by distance\n", - "),\n", - "fts_matches as (\n", - " select\n", - " rowid,\n", - " row_number() over (order by rank) as rank_number,\n", - " rank as score\n", - " from fts_headlines\n", - " where headline match :query\n", - " limit :k\n", - "),\n", - "final as (\n", - " select\n", - " articles.id,\n", - " articles.headline,\n", - " vec_matches.distance as vector_distance,\n", - " fts_matches.score as fts_score,\n", - " coalesce(1.0 / (:rrf_k + fts_matches.rowid), 0.0) * :weight_fts +\n", - " coalesce(1.0 / (:rrf_k + vec_matches.article_id), 0.0) * :weight_vec\n", - " as combined_score\n", - "\n", - " from fts_matches\n", - " full outer join vec_matches on vec_matches.article_id = fts_matches.rowid\n", - " join articles on articles.rowid = coalesce(fts_matches.rowid, vec_matches.article_id)\n", - " order by combined_score desc\n", - ")\n", - "select * from final;\n", - "\n" - ] - }, - { - "cell_type": "code", - "execution_count": 8, - "metadata": { - "vscode": { - "languageId": "sql" - } - }, - "outputs": [ - { - "data": { - "text/html": [ - "
\n", - "\n", - "\n", - "\n", - "\n", - "\n", - "\n", - "\n", - "\n", - "\n", - "\n", - "\n", - "\n", - "\n", - "
\n", - "json('[1,2,3,4]')\n", - "\n", - "vec_f32(X'AABBCCDD')\n", - "
\n", - "[1,2,3,4]\n", - "\n", - "Blob<4>\n", - "
\n", - "
\n", - "1 row × 2 columns\n", - "
\n", - "
\n" - ], - "text/plain": [ - "\u001b[0m┌\u001b[0m\u001b[0m───────────────────\u001b[0m\u001b[0m┬\u001b[0m\u001b[0m──────────────────────\u001b[0m\u001b[0m┐\n", - "\u001b[0m\u001b[0m\u001b[0m│\u001b[0m\u001b[0m \u001b[0m\u001b[0m\u001b[0mjson('[1,2,3,4]')\u001b[0m \u001b[0m\u001b[0m│\u001b[0m\u001b[0m \u001b[0m\u001b[0m\u001b[0mvec_f32(X'AABBCCDD')\u001b[0m \u001b[0m\u001b[0m│\u001b[0m\u001b[0m\n", - "\u001b[0m\u001b[0m\u001b[0m├\u001b[0m\u001b[0m───────────────────\u001b[0m\u001b[0m┼\u001b[0m\u001b[0m──────────────────────\u001b[0m\u001b[0m┤\n", - "\u001b[0m\u001b[0m\u001b[0m│\u001b[0m\u001b[0m \u001b[0m\u001b[0m\u001b[0m[1,2,3,4] \u001b[0m \u001b[0m\u001b[0m│\u001b[0m\u001b[0m \u001b[0m\u001b[0m\u001b[0m Blob<4> \u001b[0m \u001b[0m\u001b[0m│\u001b[0m\u001b[0m\n", - "\u001b[0m\u001b[0m\u001b[0m└\u001b[0m\u001b[0m───────────────────\u001b[0m\u001b[0m┴\u001b[0m\u001b[0m──────────────────────\u001b[0m\u001b[0m┘\n", - "\u001b[0m\u001b[0m" - ] - }, - "execution_count": 8, - "metadata": {}, - "output_type": "execute_result" - } - ], - "source": [ - "select json('[1,2,3,4]'), vec_f32(X'AABBCCDD')" - ] - }, - { - "cell_type": "code", - "execution_count": 9, - "metadata": { - "vscode": { - "languageId": "sql" - } - }, - "outputs": [ - { - "data": { - "text/html": [ - "
\n", - "\n", - "\n", - "\n", - "\n", - "\n", - "\n", - "\n", - "\n", - "\n", - "\n", - "\n", - "\n", - "\n", - "\n", - "\n", - "\n", - "\n", - "\n", - "\n", - "\n", - "\n", - "\n", - "\n", - "\n", - "\n", - "\n", - "\n", - "\n", - "\n", - "\n", - "\n", - "\n", - "\n", - "\n", - "\n", - "\n", - "\n", - "\n", - "\n", - "\n", - "\n", - "\n", - "\n", - "\n", - "\n", - "\n", - "\n", - "\n", - "\n", - "\n", - "\n", - "\n", - "\n", - "\n", - "\n", - "\n", - "\n", - "\n", - "\n", - "\n", - "\n", - "\n", - "\n", - "\n", - "\n", - "\n", - "\n", - "\n", - "\n", - "\n", - "\n", - "\n", - "\n", - "\n", - "\n", - "\n", - "\n", - "\n", - "\n", - "\n", - "\n", - "\n", - "\n", - "\n", - "\n", - "\n", - "\n", - "\n", - "\n", - "\n", - "\n", - "\n", - "\n", - "\n", - "\n", - "\n", - "\n", - "\n", - "\n", - "\n", - "\n", - "\n", - "\n", - "\n", - "\n", - "\n", - "\n", - "\n", - "\n", - "\n", - "\n", - "\n", - "\n", - "\n", - "\n", - "\n", - "\n", - "\n", - "\n", - "\n", - "\n", - "\n", - "\n", - "\n", - "\n", - "\n", - "\n", - "\n", - "\n", - "\n", - "\n", - "\n", - "\n", - "\n", - "\n", - "\n", - "\n", - "\n", - "\n", - "\n", - "\n", - "\n", - "\n", - "\n", - "\n", - "\n", - "\n", - "\n", - "\n", - "\n", - "\n", - "\n", - "\n", - "\n", - "\n", - "\n", - "\n", - "\n", - "\n", - "\n", - "\n", - "\n", - "\n", - "\n", - "\n", - "\n", - "\n", - "\n", - "\n", - "\n", - "\n", - "\n", - "\n", - "\n", - "\n", - "\n", - "\n", - "\n", - "\n", - "\n", - "\n", - "\n", - "\n", - "\n", - "\n", - "\n", - "\n", - "\n", - "\n", - "\n", - "\n", - "\n", - "\n", - "\n", - "\n", - "\n", - "\n", - "\n", - "\n", - "\n", - "
\n", - "addr\n", - "\n", - "opcode\n", - "\n", - "p1\n", - "\n", - "p2\n", - "\n", - "p3\n", - "\n", - "p4\n", - "\n", - "p5\n", - "\n", - "comment\n", - "\n", - "subprog\n", - "\n", - "nexec\n", - "\n", - "ncycle\n", - "
\n", - "0\n", - "\n", - "Init\n", - "\n", - "0\n", - "\n", - "12\n", - "\n", - "0\n", - "\n", - "\n", - "\n", - "0\n", - "\n", - "\n", - "\n", - "\n", - "\n", - "0\n", - "\n", - "0\n", - "
\n", - "1\n", - "\n", - "Null\n", - "\n", - "0\n", - "\n", - "1\n", - "\n", - "1\n", - "\n", - "\n", - "\n", - "0\n", - "\n", - "\n", - "\n", - "\n", - "\n", - "0\n", - "\n", - "0\n", - "
\n", - "2\n", - "\n", - "VOpen\n", - "\n", - "0\n", - "\n", - "0\n", - "\n", - "0\n", - "\n", - "vtab:7FAC27505B30\n", - "\n", - "0\n", - "\n", - "\n", - "\n", - "\n", - "\n", - "0\n", - "\n", - "0\n", - "
\n", - "3\n", - "\n", - "Integer\n", - "\n", - "0\n", - "\n", - "2\n", - "\n", - "0\n", - "\n", - "\n", - "\n", - "0\n", - "\n", - "\n", - "\n", - "\n", - "\n", - "0\n", - "\n", - "0\n", - "
\n", - "4\n", - "\n", - "Integer\n", - "\n", - "0\n", - "\n", - "3\n", - "\n", - "0\n", - "\n", - "\n", - "\n", - "0\n", - "\n", - "\n", - "\n", - "\n", - "\n", - "0\n", - "\n", - "0\n", - "
\n", - "5\n", - "\n", - "VFilter\n", - "\n", - "0\n", - "\n", - "8\n", - "\n", - "2\n", - "\n", - "\n", - "\n", - "0\n", - "\n", - "\n", - "\n", - "\n", - "\n", - "0\n", - "\n", - "0\n", - "
\n", - "6\n", - "\n", - "AggStep\n", - "\n", - "0\n", - "\n", - "0\n", - "\n", - "1\n", - "\n", - "count(0)\n", - "\n", - "0\n", - "\n", - "\n", - "\n", - "\n", - "\n", - "0\n", - "\n", - "0\n", - "
\n", - "7\n", - "\n", - "VNext\n", - "\n", - "0\n", - "\n", - "6\n", - "\n", - "0\n", - "\n", - "\n", - "\n", - "0\n", - "\n", - "\n", - "\n", - "\n", - "\n", - "0\n", - "\n", - "0\n", - "
\n", - "8\n", - "\n", - "AggFinal\n", - "\n", - "1\n", - "\n", - "0\n", - "\n", - "0\n", - "\n", - "count(0)\n", - "\n", - "0\n", - "\n", - "\n", - "\n", - "\n", - "\n", - "0\n", - "\n", - "0\n", - "
\n", - "9\n", - "\n", - "Copy\n", - "\n", - "1\n", - "\n", - "4\n", - "\n", - "0\n", - "\n", - "\n", - "\n", - "0\n", - "\n", - "\n", - "\n", - "\n", - "\n", - "0\n", - "\n", - "0\n", - "
\n", - "10\n", - "\n", - "ResultRow\n", - "\n", - "4\n", - "\n", - "1\n", - "\n", - "0\n", - "\n", - "\n", - "\n", - "0\n", - "\n", - "\n", - "\n", - "\n", - "\n", - "0\n", - "\n", - "0\n", - "
\n", - "11\n", - "\n", - "Halt\n", - "\n", - "0\n", - "\n", - "0\n", - "\n", - "0\n", - "\n", - "\n", - "\n", - "0\n", - "\n", - "\n", - "\n", - "\n", - "\n", - "0\n", - "\n", - "0\n", - "
\n", - "12\n", - "\n", - "Transaction\n", - "\n", - "0\n", - "\n", - "0\n", - "\n", - "11\n", - "\n", - "0\n", - "\n", - "1\n", - "\n", - "\n", - "\n", - "\n", - "\n", - "0\n", - "\n", - "0\n", - "
\n", - "13\n", - "\n", - "Goto\n", - "\n", - "0\n", - "\n", - "1\n", - "\n", - "0\n", - "\n", - "\n", - "\n", - "0\n", - "\n", - "\n", - "\n", - "\n", - "\n", - "0\n", - "\n", - "0\n", - "
\n", - "
\n", - "14 rows × 11 columns\n", - "
\n", - "
\n" - ], - "text/plain": [ - "\u001b[0m┌\u001b[0m\u001b[0m──────\u001b[0m\u001b[0m┬\u001b[0m\u001b[0m─────────────\u001b[0m\u001b[0m┬\u001b[0m\u001b[0m────\u001b[0m\u001b[0m┬\u001b[0m\u001b[0m────\u001b[0m\u001b[0m┬\u001b[0m\u001b[0m────\u001b[0m\u001b[0m┬\u001b[0m\u001b[0m───────────────────\u001b[0m\u001b[0m┬\u001b[0m\u001b[0m────\u001b[0m\u001b[0m┬\u001b[0m\u001b[0m─────────\u001b[0m\u001b[0m┬\u001b[0m\u001b[0m─────────\u001b[0m\u001b[0m┬\u001b[0m\u001b[0m───────\u001b[0m\u001b[0m┬\u001b[0m\u001b[0m────────\u001b[0m\u001b[0m┐\n", - "\u001b[0m\u001b[0m\u001b[0m│\u001b[0m\u001b[0m \u001b[0m\u001b[0m\u001b[0maddr\u001b[0m \u001b[0m\u001b[0m│\u001b[0m\u001b[0m \u001b[0m\u001b[0m\u001b[0mopcode \u001b[0m \u001b[0m\u001b[0m│\u001b[0m\u001b[0m \u001b[0m\u001b[0m\u001b[0mp1\u001b[0m \u001b[0m\u001b[0m│\u001b[0m\u001b[0m \u001b[0m\u001b[0m\u001b[0mp2\u001b[0m \u001b[0m\u001b[0m│\u001b[0m\u001b[0m \u001b[0m\u001b[0m\u001b[0mp3\u001b[0m \u001b[0m\u001b[0m│\u001b[0m\u001b[0m \u001b[0m\u001b[0m\u001b[0mp4 \u001b[0m \u001b[0m\u001b[0m│\u001b[0m\u001b[0m \u001b[0m\u001b[0m\u001b[0mp5\u001b[0m \u001b[0m\u001b[0m│\u001b[0m\u001b[0m \u001b[0m\u001b[0m\u001b[0mcomment\u001b[0m \u001b[0m\u001b[0m│\u001b[0m\u001b[0m \u001b[0m\u001b[0m\u001b[0msubprog\u001b[0m \u001b[0m\u001b[0m│\u001b[0m\u001b[0m \u001b[0m\u001b[0m\u001b[0mnexec\u001b[0m \u001b[0m\u001b[0m│\u001b[0m\u001b[0m \u001b[0m\u001b[0m\u001b[0mncycle\u001b[0m \u001b[0m\u001b[0m│\u001b[0m\u001b[0m\n", - "\u001b[0m\u001b[0m\u001b[0m├\u001b[0m\u001b[0m──────\u001b[0m\u001b[0m┼\u001b[0m\u001b[0m─────────────\u001b[0m\u001b[0m┼\u001b[0m\u001b[0m────\u001b[0m\u001b[0m┼\u001b[0m\u001b[0m────\u001b[0m\u001b[0m┼\u001b[0m\u001b[0m────\u001b[0m\u001b[0m┼\u001b[0m\u001b[0m───────────────────\u001b[0m\u001b[0m┼\u001b[0m\u001b[0m────\u001b[0m\u001b[0m┼\u001b[0m\u001b[0m─────────\u001b[0m\u001b[0m┼\u001b[0m\u001b[0m─────────\u001b[0m\u001b[0m┼\u001b[0m\u001b[0m───────\u001b[0m\u001b[0m┼\u001b[0m\u001b[0m────────\u001b[0m\u001b[0m┤\n", - "\u001b[0m\u001b[0m\u001b[0m│\u001b[0m\u001b[0m \u001b[0m\u001b[0m\u001b[0m 0\u001b[0m \u001b[0m\u001b[0m│\u001b[0m\u001b[0m \u001b[0m\u001b[0m\u001b[0mInit \u001b[0m \u001b[0m\u001b[0m│\u001b[0m\u001b[0m \u001b[0m\u001b[0m\u001b[0m 0\u001b[0m \u001b[0m\u001b[0m│\u001b[0m\u001b[0m \u001b[0m\u001b[0m\u001b[0m12\u001b[0m \u001b[0m\u001b[0m│\u001b[0m\u001b[0m \u001b[0m\u001b[0m\u001b[0m 0\u001b[0m \u001b[0m\u001b[0m│\u001b[0m\u001b[0m \u001b[0m\u001b[0m\u001b[0m\u001b[3m NULL \u001b[0m \u001b[0m\u001b[0m│\u001b[0m\u001b[0m \u001b[0m\u001b[0m\u001b[0m 0\u001b[0m \u001b[0m\u001b[0m│\u001b[0m\u001b[0m \u001b[0m\u001b[0m\u001b[0m\u001b[3m NULL \u001b[0m \u001b[0m\u001b[0m│\u001b[0m\u001b[0m \u001b[0m\u001b[0m\u001b[0m\u001b[3m NULL \u001b[0m \u001b[0m\u001b[0m│\u001b[0m\u001b[0m \u001b[0m\u001b[0m\u001b[0m 0\u001b[0m \u001b[0m\u001b[0m│\u001b[0m\u001b[0m \u001b[0m\u001b[0m\u001b[0m 0\u001b[0m \u001b[0m\u001b[0m│\u001b[0m\u001b[0m\n", - "\u001b[0m\u001b[0m\u001b[0m│\u001b[0m\u001b[0m \u001b[0m\u001b[0m\u001b[0m 1\u001b[0m \u001b[0m\u001b[0m│\u001b[0m\u001b[0m \u001b[0m\u001b[0m\u001b[0mNull \u001b[0m \u001b[0m\u001b[0m│\u001b[0m\u001b[0m \u001b[0m\u001b[0m\u001b[0m 0\u001b[0m \u001b[0m\u001b[0m│\u001b[0m\u001b[0m \u001b[0m\u001b[0m\u001b[0m 1\u001b[0m \u001b[0m\u001b[0m│\u001b[0m\u001b[0m \u001b[0m\u001b[0m\u001b[0m 1\u001b[0m \u001b[0m\u001b[0m│\u001b[0m\u001b[0m \u001b[0m\u001b[0m\u001b[0m\u001b[3m NULL \u001b[0m \u001b[0m\u001b[0m│\u001b[0m\u001b[0m \u001b[0m\u001b[0m\u001b[0m 0\u001b[0m \u001b[0m\u001b[0m│\u001b[0m\u001b[0m \u001b[0m\u001b[0m\u001b[0m\u001b[3m NULL \u001b[0m \u001b[0m\u001b[0m│\u001b[0m\u001b[0m \u001b[0m\u001b[0m\u001b[0m\u001b[3m NULL \u001b[0m \u001b[0m\u001b[0m│\u001b[0m\u001b[0m \u001b[0m\u001b[0m\u001b[0m 0\u001b[0m \u001b[0m\u001b[0m│\u001b[0m\u001b[0m \u001b[0m\u001b[0m\u001b[0m 0\u001b[0m \u001b[0m\u001b[0m│\u001b[0m\u001b[0m\n", - "\u001b[0m\u001b[0m\u001b[0m│\u001b[0m\u001b[0m \u001b[0m\u001b[0m\u001b[0m 2\u001b[0m \u001b[0m\u001b[0m│\u001b[0m\u001b[0m \u001b[0m\u001b[0m\u001b[0mVOpen \u001b[0m \u001b[0m\u001b[0m│\u001b[0m\u001b[0m \u001b[0m\u001b[0m\u001b[0m 0\u001b[0m \u001b[0m\u001b[0m│\u001b[0m\u001b[0m \u001b[0m\u001b[0m\u001b[0m 0\u001b[0m \u001b[0m\u001b[0m│\u001b[0m\u001b[0m \u001b[0m\u001b[0m\u001b[0m 0\u001b[0m \u001b[0m\u001b[0m│\u001b[0m\u001b[0m \u001b[0m\u001b[0m\u001b[0mvtab:7FAC27505B30\u001b[0m \u001b[0m\u001b[0m│\u001b[0m\u001b[0m \u001b[0m\u001b[0m\u001b[0m 0\u001b[0m \u001b[0m\u001b[0m│\u001b[0m\u001b[0m \u001b[0m\u001b[0m\u001b[0m\u001b[3m NULL \u001b[0m \u001b[0m\u001b[0m│\u001b[0m\u001b[0m \u001b[0m\u001b[0m\u001b[0m\u001b[3m NULL \u001b[0m \u001b[0m\u001b[0m│\u001b[0m\u001b[0m \u001b[0m\u001b[0m\u001b[0m 0\u001b[0m \u001b[0m\u001b[0m│\u001b[0m\u001b[0m \u001b[0m\u001b[0m\u001b[0m 0\u001b[0m \u001b[0m\u001b[0m│\u001b[0m\u001b[0m\n", - "\u001b[0m\u001b[0m\u001b[0m│\u001b[0m\u001b[0m \u001b[0m\u001b[0m\u001b[0m 3\u001b[0m \u001b[0m\u001b[0m│\u001b[0m\u001b[0m \u001b[0m\u001b[0m\u001b[0mInteger \u001b[0m \u001b[0m\u001b[0m│\u001b[0m\u001b[0m \u001b[0m\u001b[0m\u001b[0m 0\u001b[0m \u001b[0m\u001b[0m│\u001b[0m\u001b[0m \u001b[0m\u001b[0m\u001b[0m 2\u001b[0m \u001b[0m\u001b[0m│\u001b[0m\u001b[0m \u001b[0m\u001b[0m\u001b[0m 0\u001b[0m \u001b[0m\u001b[0m│\u001b[0m\u001b[0m \u001b[0m\u001b[0m\u001b[0m\u001b[3m NULL \u001b[0m \u001b[0m\u001b[0m│\u001b[0m\u001b[0m \u001b[0m\u001b[0m\u001b[0m 0\u001b[0m \u001b[0m\u001b[0m│\u001b[0m\u001b[0m \u001b[0m\u001b[0m\u001b[0m\u001b[3m NULL \u001b[0m \u001b[0m\u001b[0m│\u001b[0m\u001b[0m \u001b[0m\u001b[0m\u001b[0m\u001b[3m NULL \u001b[0m \u001b[0m\u001b[0m│\u001b[0m\u001b[0m \u001b[0m\u001b[0m\u001b[0m 0\u001b[0m \u001b[0m\u001b[0m│\u001b[0m\u001b[0m \u001b[0m\u001b[0m\u001b[0m 0\u001b[0m \u001b[0m\u001b[0m│\u001b[0m\u001b[0m\n", - "\u001b[0m\u001b[0m\u001b[0m│\u001b[0m\u001b[0m \u001b[0m\u001b[0m\u001b[0m 4\u001b[0m \u001b[0m\u001b[0m│\u001b[0m\u001b[0m \u001b[0m\u001b[0m\u001b[0mInteger \u001b[0m \u001b[0m\u001b[0m│\u001b[0m\u001b[0m \u001b[0m\u001b[0m\u001b[0m 0\u001b[0m \u001b[0m\u001b[0m│\u001b[0m\u001b[0m \u001b[0m\u001b[0m\u001b[0m 3\u001b[0m \u001b[0m\u001b[0m│\u001b[0m\u001b[0m \u001b[0m\u001b[0m\u001b[0m 0\u001b[0m \u001b[0m\u001b[0m│\u001b[0m\u001b[0m \u001b[0m\u001b[0m\u001b[0m\u001b[3m NULL \u001b[0m \u001b[0m\u001b[0m│\u001b[0m\u001b[0m \u001b[0m\u001b[0m\u001b[0m 0\u001b[0m \u001b[0m\u001b[0m│\u001b[0m\u001b[0m \u001b[0m\u001b[0m\u001b[0m\u001b[3m NULL \u001b[0m \u001b[0m\u001b[0m│\u001b[0m\u001b[0m \u001b[0m\u001b[0m\u001b[0m\u001b[3m NULL \u001b[0m \u001b[0m\u001b[0m│\u001b[0m\u001b[0m \u001b[0m\u001b[0m\u001b[0m 0\u001b[0m \u001b[0m\u001b[0m│\u001b[0m\u001b[0m \u001b[0m\u001b[0m\u001b[0m 0\u001b[0m \u001b[0m\u001b[0m│\u001b[0m\u001b[0m\n", - "\u001b[0m\u001b[0m\u001b[0m│\u001b[0m\u001b[0m \u001b[0m\u001b[0m\u001b[0m 5\u001b[0m \u001b[0m\u001b[0m│\u001b[0m\u001b[0m \u001b[0m\u001b[0m\u001b[0mVFilter \u001b[0m \u001b[0m\u001b[0m│\u001b[0m\u001b[0m \u001b[0m\u001b[0m\u001b[0m 0\u001b[0m \u001b[0m\u001b[0m│\u001b[0m\u001b[0m \u001b[0m\u001b[0m\u001b[0m 8\u001b[0m \u001b[0m\u001b[0m│\u001b[0m\u001b[0m \u001b[0m\u001b[0m\u001b[0m 2\u001b[0m \u001b[0m\u001b[0m│\u001b[0m\u001b[0m \u001b[0m\u001b[0m\u001b[0m\u001b[3m NULL \u001b[0m \u001b[0m\u001b[0m│\u001b[0m\u001b[0m \u001b[0m\u001b[0m\u001b[0m 0\u001b[0m \u001b[0m\u001b[0m│\u001b[0m\u001b[0m \u001b[0m\u001b[0m\u001b[0m\u001b[3m NULL \u001b[0m \u001b[0m\u001b[0m│\u001b[0m\u001b[0m \u001b[0m\u001b[0m\u001b[0m\u001b[3m NULL \u001b[0m \u001b[0m\u001b[0m│\u001b[0m\u001b[0m \u001b[0m\u001b[0m\u001b[0m 0\u001b[0m \u001b[0m\u001b[0m│\u001b[0m\u001b[0m \u001b[0m\u001b[0m\u001b[0m 0\u001b[0m \u001b[0m\u001b[0m│\u001b[0m\u001b[0m\n", - "\u001b[0m\u001b[0m\u001b[0m│\u001b[0m\u001b[0m \u001b[0m\u001b[0m\u001b[0m 6\u001b[0m \u001b[0m\u001b[0m│\u001b[0m\u001b[0m \u001b[0m\u001b[0m\u001b[0mAggStep \u001b[0m \u001b[0m\u001b[0m│\u001b[0m\u001b[0m \u001b[0m\u001b[0m\u001b[0m 0\u001b[0m \u001b[0m\u001b[0m│\u001b[0m\u001b[0m \u001b[0m\u001b[0m\u001b[0m 0\u001b[0m \u001b[0m\u001b[0m│\u001b[0m\u001b[0m \u001b[0m\u001b[0m\u001b[0m 1\u001b[0m \u001b[0m\u001b[0m│\u001b[0m\u001b[0m \u001b[0m\u001b[0m\u001b[0mcount(0) \u001b[0m \u001b[0m\u001b[0m│\u001b[0m\u001b[0m \u001b[0m\u001b[0m\u001b[0m 0\u001b[0m \u001b[0m\u001b[0m│\u001b[0m\u001b[0m \u001b[0m\u001b[0m\u001b[0m\u001b[3m NULL \u001b[0m \u001b[0m\u001b[0m│\u001b[0m\u001b[0m \u001b[0m\u001b[0m\u001b[0m\u001b[3m NULL \u001b[0m \u001b[0m\u001b[0m│\u001b[0m\u001b[0m \u001b[0m\u001b[0m\u001b[0m 0\u001b[0m \u001b[0m\u001b[0m│\u001b[0m\u001b[0m \u001b[0m\u001b[0m\u001b[0m 0\u001b[0m \u001b[0m\u001b[0m│\u001b[0m\u001b[0m\n", - "\u001b[0m\u001b[0m\u001b[0m│\u001b[0m\u001b[0m \u001b[0m\u001b[0m\u001b[0m 7\u001b[0m \u001b[0m\u001b[0m│\u001b[0m\u001b[0m \u001b[0m\u001b[0m\u001b[0mVNext \u001b[0m \u001b[0m\u001b[0m│\u001b[0m\u001b[0m \u001b[0m\u001b[0m\u001b[0m 0\u001b[0m \u001b[0m\u001b[0m│\u001b[0m\u001b[0m \u001b[0m\u001b[0m\u001b[0m 6\u001b[0m \u001b[0m\u001b[0m│\u001b[0m\u001b[0m \u001b[0m\u001b[0m\u001b[0m 0\u001b[0m \u001b[0m\u001b[0m│\u001b[0m\u001b[0m \u001b[0m\u001b[0m\u001b[0m\u001b[3m NULL \u001b[0m \u001b[0m\u001b[0m│\u001b[0m\u001b[0m \u001b[0m\u001b[0m\u001b[0m 0\u001b[0m \u001b[0m\u001b[0m│\u001b[0m\u001b[0m \u001b[0m\u001b[0m\u001b[0m\u001b[3m NULL \u001b[0m \u001b[0m\u001b[0m│\u001b[0m\u001b[0m \u001b[0m\u001b[0m\u001b[0m\u001b[3m NULL \u001b[0m \u001b[0m\u001b[0m│\u001b[0m\u001b[0m \u001b[0m\u001b[0m\u001b[0m 0\u001b[0m \u001b[0m\u001b[0m│\u001b[0m\u001b[0m \u001b[0m\u001b[0m\u001b[0m 0\u001b[0m \u001b[0m\u001b[0m│\u001b[0m\u001b[0m\n", - "\u001b[0m\u001b[0m\u001b[0m│\u001b[0m\u001b[0m \u001b[0m\u001b[0m\u001b[0m 8\u001b[0m \u001b[0m\u001b[0m│\u001b[0m\u001b[0m \u001b[0m\u001b[0m\u001b[0mAggFinal \u001b[0m \u001b[0m\u001b[0m│\u001b[0m\u001b[0m \u001b[0m\u001b[0m\u001b[0m 1\u001b[0m \u001b[0m\u001b[0m│\u001b[0m\u001b[0m \u001b[0m\u001b[0m\u001b[0m 0\u001b[0m \u001b[0m\u001b[0m│\u001b[0m\u001b[0m \u001b[0m\u001b[0m\u001b[0m 0\u001b[0m \u001b[0m\u001b[0m│\u001b[0m\u001b[0m \u001b[0m\u001b[0m\u001b[0mcount(0) \u001b[0m \u001b[0m\u001b[0m│\u001b[0m\u001b[0m \u001b[0m\u001b[0m\u001b[0m 0\u001b[0m \u001b[0m\u001b[0m│\u001b[0m\u001b[0m \u001b[0m\u001b[0m\u001b[0m\u001b[3m NULL \u001b[0m \u001b[0m\u001b[0m│\u001b[0m\u001b[0m \u001b[0m\u001b[0m\u001b[0m\u001b[3m NULL \u001b[0m \u001b[0m\u001b[0m│\u001b[0m\u001b[0m \u001b[0m\u001b[0m\u001b[0m 0\u001b[0m \u001b[0m\u001b[0m│\u001b[0m\u001b[0m \u001b[0m\u001b[0m\u001b[0m 0\u001b[0m \u001b[0m\u001b[0m│\u001b[0m\u001b[0m\n", - "\u001b[0m\u001b[0m\u001b[0m│\u001b[0m\u001b[0m \u001b[0m\u001b[0m\u001b[0m 9\u001b[0m \u001b[0m\u001b[0m│\u001b[0m\u001b[0m \u001b[0m\u001b[0m\u001b[0mCopy \u001b[0m \u001b[0m\u001b[0m│\u001b[0m\u001b[0m \u001b[0m\u001b[0m\u001b[0m 1\u001b[0m \u001b[0m\u001b[0m│\u001b[0m\u001b[0m \u001b[0m\u001b[0m\u001b[0m 4\u001b[0m \u001b[0m\u001b[0m│\u001b[0m\u001b[0m \u001b[0m\u001b[0m\u001b[0m 0\u001b[0m \u001b[0m\u001b[0m│\u001b[0m\u001b[0m \u001b[0m\u001b[0m\u001b[0m\u001b[3m NULL \u001b[0m \u001b[0m\u001b[0m│\u001b[0m\u001b[0m \u001b[0m\u001b[0m\u001b[0m 0\u001b[0m \u001b[0m\u001b[0m│\u001b[0m\u001b[0m \u001b[0m\u001b[0m\u001b[0m\u001b[3m NULL \u001b[0m \u001b[0m\u001b[0m│\u001b[0m\u001b[0m \u001b[0m\u001b[0m\u001b[0m\u001b[3m NULL \u001b[0m \u001b[0m\u001b[0m│\u001b[0m\u001b[0m \u001b[0m\u001b[0m\u001b[0m 0\u001b[0m \u001b[0m\u001b[0m│\u001b[0m\u001b[0m \u001b[0m\u001b[0m\u001b[0m 0\u001b[0m \u001b[0m\u001b[0m│\u001b[0m\u001b[0m\n", - "\u001b[0m\u001b[0m\u001b[0m│\u001b[0m\u001b[0m \u001b[0m\u001b[0m\u001b[0m 10\u001b[0m \u001b[0m\u001b[0m│\u001b[0m\u001b[0m \u001b[0m\u001b[0m\u001b[0mResultRow \u001b[0m \u001b[0m\u001b[0m│\u001b[0m\u001b[0m \u001b[0m\u001b[0m\u001b[0m 4\u001b[0m \u001b[0m\u001b[0m│\u001b[0m\u001b[0m \u001b[0m\u001b[0m\u001b[0m 1\u001b[0m \u001b[0m\u001b[0m│\u001b[0m\u001b[0m \u001b[0m\u001b[0m\u001b[0m 0\u001b[0m \u001b[0m\u001b[0m│\u001b[0m\u001b[0m \u001b[0m\u001b[0m\u001b[0m\u001b[3m NULL \u001b[0m \u001b[0m\u001b[0m│\u001b[0m\u001b[0m \u001b[0m\u001b[0m\u001b[0m 0\u001b[0m \u001b[0m\u001b[0m│\u001b[0m\u001b[0m \u001b[0m\u001b[0m\u001b[0m\u001b[3m NULL \u001b[0m \u001b[0m\u001b[0m│\u001b[0m\u001b[0m \u001b[0m\u001b[0m\u001b[0m\u001b[3m NULL \u001b[0m \u001b[0m\u001b[0m│\u001b[0m\u001b[0m \u001b[0m\u001b[0m\u001b[0m 0\u001b[0m \u001b[0m\u001b[0m│\u001b[0m\u001b[0m \u001b[0m\u001b[0m\u001b[0m 0\u001b[0m \u001b[0m\u001b[0m│\u001b[0m\u001b[0m\n", - "\u001b[0m\u001b[0m\u001b[0m│\u001b[0m\u001b[0m \u001b[0m\u001b[0m\u001b[0m 11\u001b[0m \u001b[0m\u001b[0m│\u001b[0m\u001b[0m \u001b[0m\u001b[0m\u001b[0mHalt \u001b[0m \u001b[0m\u001b[0m│\u001b[0m\u001b[0m \u001b[0m\u001b[0m\u001b[0m 0\u001b[0m \u001b[0m\u001b[0m│\u001b[0m\u001b[0m \u001b[0m\u001b[0m\u001b[0m 0\u001b[0m \u001b[0m\u001b[0m│\u001b[0m\u001b[0m \u001b[0m\u001b[0m\u001b[0m 0\u001b[0m \u001b[0m\u001b[0m│\u001b[0m\u001b[0m \u001b[0m\u001b[0m\u001b[0m\u001b[3m NULL \u001b[0m \u001b[0m\u001b[0m│\u001b[0m\u001b[0m \u001b[0m\u001b[0m\u001b[0m 0\u001b[0m \u001b[0m\u001b[0m│\u001b[0m\u001b[0m \u001b[0m\u001b[0m\u001b[0m\u001b[3m NULL \u001b[0m \u001b[0m\u001b[0m│\u001b[0m\u001b[0m \u001b[0m\u001b[0m\u001b[0m\u001b[3m NULL \u001b[0m \u001b[0m\u001b[0m│\u001b[0m\u001b[0m \u001b[0m\u001b[0m\u001b[0m 0\u001b[0m \u001b[0m\u001b[0m│\u001b[0m\u001b[0m \u001b[0m\u001b[0m\u001b[0m 0\u001b[0m \u001b[0m\u001b[0m│\u001b[0m\u001b[0m\n", - "\u001b[0m\u001b[0m\u001b[0m│\u001b[0m\u001b[0m \u001b[0m\u001b[0m\u001b[0m 12\u001b[0m \u001b[0m\u001b[0m│\u001b[0m\u001b[0m \u001b[0m\u001b[0m\u001b[0mTransaction\u001b[0m \u001b[0m\u001b[0m│\u001b[0m\u001b[0m \u001b[0m\u001b[0m\u001b[0m 0\u001b[0m \u001b[0m\u001b[0m│\u001b[0m\u001b[0m \u001b[0m\u001b[0m\u001b[0m 0\u001b[0m \u001b[0m\u001b[0m│\u001b[0m\u001b[0m \u001b[0m\u001b[0m\u001b[0m11\u001b[0m \u001b[0m\u001b[0m│\u001b[0m\u001b[0m \u001b[0m\u001b[0m\u001b[0m0 \u001b[0m \u001b[0m\u001b[0m│\u001b[0m\u001b[0m \u001b[0m\u001b[0m\u001b[0m 1\u001b[0m \u001b[0m\u001b[0m│\u001b[0m\u001b[0m \u001b[0m\u001b[0m\u001b[0m\u001b[3m NULL \u001b[0m \u001b[0m\u001b[0m│\u001b[0m\u001b[0m \u001b[0m\u001b[0m\u001b[0m\u001b[3m NULL \u001b[0m \u001b[0m\u001b[0m│\u001b[0m\u001b[0m \u001b[0m\u001b[0m\u001b[0m 0\u001b[0m \u001b[0m\u001b[0m│\u001b[0m\u001b[0m \u001b[0m\u001b[0m\u001b[0m 0\u001b[0m \u001b[0m\u001b[0m│\u001b[0m\u001b[0m\n", - "\u001b[0m\u001b[0m\u001b[0m│\u001b[0m\u001b[0m \u001b[0m\u001b[0m\u001b[0m 13\u001b[0m \u001b[0m\u001b[0m│\u001b[0m\u001b[0m \u001b[0m\u001b[0m\u001b[0mGoto \u001b[0m \u001b[0m\u001b[0m│\u001b[0m\u001b[0m \u001b[0m\u001b[0m\u001b[0m 0\u001b[0m \u001b[0m\u001b[0m│\u001b[0m\u001b[0m \u001b[0m\u001b[0m\u001b[0m 1\u001b[0m \u001b[0m\u001b[0m│\u001b[0m\u001b[0m \u001b[0m\u001b[0m\u001b[0m 0\u001b[0m \u001b[0m\u001b[0m│\u001b[0m\u001b[0m \u001b[0m\u001b[0m\u001b[0m\u001b[3m NULL \u001b[0m \u001b[0m\u001b[0m│\u001b[0m\u001b[0m \u001b[0m\u001b[0m\u001b[0m 0\u001b[0m \u001b[0m\u001b[0m│\u001b[0m\u001b[0m \u001b[0m\u001b[0m\u001b[0m\u001b[3m NULL \u001b[0m \u001b[0m\u001b[0m│\u001b[0m\u001b[0m \u001b[0m\u001b[0m\u001b[0m\u001b[3m NULL \u001b[0m \u001b[0m\u001b[0m│\u001b[0m\u001b[0m \u001b[0m\u001b[0m\u001b[0m 0\u001b[0m \u001b[0m\u001b[0m│\u001b[0m\u001b[0m \u001b[0m\u001b[0m\u001b[0m 0\u001b[0m \u001b[0m\u001b[0m│\u001b[0m\u001b[0m\n", - "\u001b[0m\u001b[0m\u001b[0m└\u001b[0m\u001b[0m──────\u001b[0m\u001b[0m┴\u001b[0m\u001b[0m─────────────\u001b[0m\u001b[0m┴\u001b[0m\u001b[0m────\u001b[0m\u001b[0m┴\u001b[0m\u001b[0m────\u001b[0m\u001b[0m┴\u001b[0m\u001b[0m────\u001b[0m\u001b[0m┴\u001b[0m\u001b[0m───────────────────\u001b[0m\u001b[0m┴\u001b[0m\u001b[0m────\u001b[0m\u001b[0m┴\u001b[0m\u001b[0m─────────\u001b[0m\u001b[0m┴\u001b[0m\u001b[0m─────────\u001b[0m\u001b[0m┴\u001b[0m\u001b[0m───────\u001b[0m\u001b[0m┴\u001b[0m\u001b[0m────────\u001b[0m\u001b[0m┘\n", - "\u001b[0m\u001b[0m" - ] - }, - "execution_count": 9, - "metadata": {}, - "output_type": "execute_result" - } - ], - "source": [ - "select * from bytecode('select count(*) from pragma_table_list;')" - ] - }, - { - "cell_type": "markdown", - "metadata": {}, - "source": [] - } - ], - "metadata": { - "kernelspec": { - "display_name": "Solite", - "language": "sql", - "name": "solite" - }, - "language_info": { - "file_extension": ".sql", - "mimetype": "text/x.sqlite", - "name": "sqlite", - "nb_converter": "script", - "pygments_lexer": "sql", - "version": "TODO" - } - }, - "nbformat": 4, - "nbformat_minor": 2 -} diff --git a/examples/nbc-headlines/query.sql b/examples/nbc-headlines/query.sql deleted file mode 100644 index 6ac98a4..0000000 --- a/examples/nbc-headlines/query.sql +++ /dev/null @@ -1,57 +0,0 @@ -.load ../../dist/vec0 -.load ./rembed0 -insert into rembed_clients(name, options) - values ('snowflake-arctic-embed-m-v1.5', 'llamafile'); - -.bail on -.mode box -.header on -.timer on - -.param set :query 'death row' -.param set :weight_fts 1.0 -.param set :weight_vec 1.0 -.param set :rrf_k 60 -.param set :query_embedding "vec_normalize(vec_slice(rembed('snowflake-arctic-embed-m-v1.5', :query), 0, 256))" -.param set :k 10 - -select 'Hybrid w/ RRF' as ""; - -with vec_matches as ( - select - article_id, - row_number() over (order by distance) as rank_number, - distance - from vec_headlines - where - headline_embedding match :query_embedding - and k = :k - order by distance -), -fts_matches as ( - select - rowid, - --highlight(fts_headlines, 0, '', '') as headline_highlighted, - row_number() over (order by rank) as rank_number, - rank as score - from fts_headlines - where headline match :query - limit :k -), -final as ( - select - articles.id, - articles.headline, - vec_matches.distance as vector_distance, - fts_matches.score as fts_score, - coalesce(1.0 / (:rrf_k + fts_matches.rowid), 0.0) * :weight_fts + - coalesce(1.0 / (:rrf_k + vec_matches.article_id), 0.0) * :weight_vec - as combined_score - - from fts_matches - full outer join vec_matches on vec_matches.article_id = fts_matches.rowid - join articles on articles.rowid = coalesce(fts_matches.rowid, vec_matches.article_id) - order by combined_score desc -) -select * from final; -