kandi background
Explore Kits

questdb | open source SQL database designed to process time series data | Time Series Database library

 by   questdb Java Version: 6.2.1 License: Apache-2.0

 by   questdb Java Version: 6.2.1 License: Apache-2.0

Download this library from

kandi X-RAY | questdb Summary

questdb is a Java library typically used in Database, Time Series Database applications. questdb has no bugs, it has no vulnerabilities, it has build file available, it has a Permissive License and it has medium support. You can install using 'pip install questdb' or download it from GitHub, PyPI.
QuestDB is a high-performance, open-source SQL database for applications in financial services, IoT, machine learning, DevOps and observability. It includes endpoints for PostgreSQL wire protocol, high-throughput schema-agnostic ingestion using InfluxDB Line Protocol, and a REST API for queries, bulk imports, and exports. QuestDB implements ANSI SQL with native extensions for time-oriented language features. These extensions make it simple to correlate data from multiple sources using relational and time series joins. QuestDB achieves high performance from a column-oriented storage model, massively-parallelized vector execution, SIMD instructions, and various low-latency techniques. The entire codebase was built from the ground up in Java and C++, with no dependencies, and is 100% free from garbage collection.
Support
Support
Quality
Quality
Security
Security
License
License
Reuse
Reuse

kandi-support Support

  • questdb has a medium active ecosystem.
  • It has 8390 star(s) with 462 fork(s). There are 108 watchers for this library.
  • There were 1 major release(s) in the last 6 months.
  • There are 200 open issues and 551 have been closed. On average issues are closed in 64 days. There are 9 open pull requests and 0 closed requests.
  • It has a neutral sentiment in the developer community.
  • The latest version of questdb is 6.2.1
questdb Support
Best in #Time Series Database
Average in #Time Series Database
questdb Support
Best in #Time Series Database
Average in #Time Series Database

quality kandi Quality

  • questdb has 0 bugs and 0 code smells.
questdb Quality
Best in #Time Series Database
Average in #Time Series Database
questdb Quality
Best in #Time Series Database
Average in #Time Series Database

securitySecurity

  • questdb has no vulnerabilities reported, and its dependent libraries have no vulnerabilities reported.
  • questdb code analysis shows 0 unresolved vulnerabilities.
  • There are 0 security hotspots that need review.
questdb Security
Best in #Time Series Database
Average in #Time Series Database
questdb Security
Best in #Time Series Database
Average in #Time Series Database

license License

  • questdb is licensed under the Apache-2.0 License. This license is Permissive.
  • Permissive licenses have the least restrictions, and you can use them in most projects.
questdb License
Best in #Time Series Database
Average in #Time Series Database
questdb License
Best in #Time Series Database
Average in #Time Series Database

buildReuse

  • questdb releases are available to install and integrate.
  • Deployable package is available in PyPI.
  • Build file is available. You can build the component from source.
  • Installation instructions are not available. Examples and code snippets are available.
  • It has 327483 lines of code, 25136 functions and 2229 files.
  • It has medium code complexity. Code complexity directly impacts maintainability of the code.
questdb Reuse
Best in #Time Series Database
Average in #Time Series Database
questdb Reuse
Best in #Time Series Database
Average in #Time Series Database
Top functions reviewed by kandi - BETA

kandi has reviewed questdb and discovered the below as its top functions. This is intended to give you an instant insight into questdb implemented functionality, and help decide if they suit your requirements.

  • Returns the initial seed value .
  • Assemble the parse method invocation .
  • Generate table query .
  • assembles a RecordToRowCopier
  • Publish multiple copy tasks .
  • Sorts the elements in sorted sequence .
  • Commit o3 .
  • Rewrite select clause .
  • Format time in milliseconds .
  • Create a function .

questdb Key Features

An open source SQL database designed to process time series data, faster

Try QuestDB

copy iconCopydownload iconDownload
docker run -p 9000:9000 -p 9009:9009 -p 8812:8812 questdb/questdb

How do I aggregate open and close values in QuestDB using SAMPLE BY

copy iconCopydownload iconDownload
select max(high) high,
    min(low) low,
    first(open) as open,
    last(close) as close
from ohlc
SAMPLE BY 1M

How to generate a monthly report filling missing days of the month with zero

copy iconCopydownload iconDownload
SELECT x as day, COALESCE(sb.count_items, 0) AS count_items
from long_sequence(31) ls
LEFT JOIN (
   SELECT DAY(ts) as day, COUNT_DISTINCT(item) AS count_items
   FROM my_table
   WHERE ts IN '2020-01'
   SAMPLE BY d
) AS sb ON sb.day = ls.x
-----------------------
SELECT x as day, COALESCE(sb.count_items, 0) AS count_items
from long_sequence(DAYS_IN_MONTH('2020-01') ls
LEFT JOIN (
   SELECT CAST(DAY(ts) AS LONG) as day, COUNT_DISTINCT(item) AS count_items
   FROM my_table
   WHERE ts IN '2020-01'
   SAMPLE BY d
) AS sb ON sb.day = ls.x

QuestDB : difference between table_columns() and tables()

copy iconCopydownload iconDownload
table_columns('pos')

or

SHOW COLUMNS FROM 'mytable'

When working with QuestDB, are symbol columns good for performance for huge amounts of rows each?

copy iconCopydownload iconDownload
|----------------------------------|
| time |  stock1 | stock1 | stock3 |
|----------------------------------|

|----------------------------------|
| time |  stock1 | stock1 | stock3 |
|----------------------------------|
| t1   |     1.1 |        |        |
| t2   |         |   3.45 |        |
| t3   |         |        | 103.45 |
|----------------------------------|
-----------------------
|----------------------------------|
| time |  stock1 | stock1 | stock3 |
|----------------------------------|

|----------------------------------|
| time |  stock1 | stock1 | stock3 |
|----------------------------------|
| t1   |     1.1 |        |        |
| t2   |         |   3.45 |        |
| t3   |         |        | 103.45 |
|----------------------------------|

How can I store MQTT data into QuestDB?

copy iconCopydownload iconDownload
# Configuration for Telegraf agent
[agent]
  ## Default data collection interval for all inputs
  interval = "5s"
  hostname = "qdb"

[[outputs.socket_writer]]
  # Write metrics to a local QuestDB instance over TCP
  address = "tcp://127.0.0.1:9009"

[[inputs.mqtt_consumer]]
  ## The MQTT broker
  servers = ["tcp://127.0.0.1:1883"]

  ## Topics that will be subscribed to.
  topics = [
    "telegraf/host01/cpu",
    "telegraf/+/mem",
    "sensors/#",
  ]

How can I update a QuestDB docker version without losing the container's data?

copy iconCopydownload iconDownload
# copy the contents of the old_questdb container to the current dir
docker cp old_questdb:/root/.questdb $(pwd)

# run 6.0.4 and mount to the current dir
docker run --name new_questdb \
-v "$(pwd)/.questdb:/root/.questdb/" \
-p 9000:9000 -p 9009:9009 questdb/questdb:6.0.4

How can I plot a moving average from Pandas to a chart?

copy iconCopydownload iconDownload
import psycopg2
import pandas as pd
import plotly.graph_objects as go

df_trades = pd.DataFrame()

try:
    connection = psycopg2.connect(user="admin",
                                  password="quest",
                                  host="127.0.0.1",
                                  port="8812",
                                  database="qdb")
    cursor = connection.cursor()
    df_trades = pd.read_sql_query("select * from my_table",connection)

except (Exception, psycopg2.Error) as error:
    print("Error while connecting to QuestDB", error)
finally:
    if (connection):
        cursor.close()
        connection.close()
        print("QuestDB connection closed")

print(df_trades.head())

fig = go.Figure()

fig.update_layout(title_text="Table candlestick")

df_trades['10point_ma'] = df_trades['close'].rolling(window=10).mean()

fig.add_trace(go.Scatter(x=df_trades['ts'], y=df_trades['10point_ma'], 
                            name='10 point moving average',
                            mode='lines',
                            opacity=1,
                            marker=dict(color='MediumPurple',
                            size=1)))

# original table as candlestick chart
fig.add_trace(go.Candlestick(x=df_trades['ts'],
                            open=df_trades['open'],
                            high=df_trades['high'],
                            low=df_trades['low'],
                            close=df_trades['close'],
                            name='My Awesome Chart'))

fig.update(layout_xaxis_rangeslider_visible=False)
fig.show()

How do I get query results from QuestDB into a Pandas dataframe?

copy iconCopydownload iconDownload
import psycopg2
import pandas as pd

dataframe = pd.DataFrame()
try:
    connection = psycopg2.connect(user="admin",
                                  password="quest",
                                  host="127.0.0.1",
                                  port="8812",
                                  database="qdb")
    cursor = connection.cursor()
    dataframe = pd.read_sql_query("select * from my_table",connection)

except (Exception, psycopg2.Error) as error:
    print("Error while connecting to QuestDB", error)
finally:
    if (connection):
        cursor.close()
        connection.close()
        print("QuestDB connection closed")
print(dataframe)
                    timestamp  event  origin
0  2021-08-23 12:15:43.582771    100       1
1  2021-08-23 12:15:46.529379      1       2
2  2021-08-23 12:15:46.656823      1       2
3  2021-08-23 12:15:46.662040      1       2
4  2021-08-23 12:15:46.805505      1       2
5  2021-08-23 12:15:46.807359      1       2
6  2021-08-23 12:15:48.631560      1       2
7  2021-08-23 12:16:08.120285      6       3
8  2021-08-23 12:16:58.080873      6       3
9  2021-08-23 12:16:58.081986      6       3
10 2021-08-23 12:16:58.084083      1       3
-----------------------
import psycopg2
import pandas as pd

dataframe = pd.DataFrame()
try:
    connection = psycopg2.connect(user="admin",
                                  password="quest",
                                  host="127.0.0.1",
                                  port="8812",
                                  database="qdb")
    cursor = connection.cursor()
    dataframe = pd.read_sql_query("select * from my_table",connection)

except (Exception, psycopg2.Error) as error:
    print("Error while connecting to QuestDB", error)
finally:
    if (connection):
        cursor.close()
        connection.close()
        print("QuestDB connection closed")
print(dataframe)
                    timestamp  event  origin
0  2021-08-23 12:15:43.582771    100       1
1  2021-08-23 12:15:46.529379      1       2
2  2021-08-23 12:15:46.656823      1       2
3  2021-08-23 12:15:46.662040      1       2
4  2021-08-23 12:15:46.805505      1       2
5  2021-08-23 12:15:46.807359      1       2
6  2021-08-23 12:15:48.631560      1       2
7  2021-08-23 12:16:08.120285      6       3
8  2021-08-23 12:16:58.080873      6       3
9  2021-08-23 12:16:58.081986      6       3
10 2021-08-23 12:16:58.084083      1       3

What does '[24] could not open read-only' error mean while benchmarking QuestDB in docker?

copy iconCopydownload iconDownload
docker run --ulimit nofile=5000:5000 \
-p 9000:9000 -p 8812:8812 -p 9009:9009 \
questdb/questdb

How to avoid error "Cannot insert rows out of order" in QuestDB?

copy iconCopydownload iconDownload
create table records2(
 type INT,
 interval INT,
 timestamp TIMESTAMP,
 name STRING
) 
timestamp(timestamp) partition by DAY

insert into records2
select * from records

drop table records

rename table records2 to records

Community Discussions

Trending Discussions on questdb
  • What is a equivalent of a merge query(insert/update/delete) is present in the QuestDB?
  • How do I aggregate open and close values in QuestDB using SAMPLE BY
  • How to generate a monthly report filling missing days of the month with zero
  • Quest DB failed to run tutorial data insertion using Java with line protocol
  • QuestDB : difference between table_columns() and tables()
  • Did the Quesdb performance change with the implementation of the new geohash type?
  • QuestDB invalid metadata version
  • Is there an NPM package for QuestDB?
  • When working with QuestDB, are symbol columns good for performance for huge amounts of rows each?
  • How can I store MQTT data into QuestDB?
Trending Discussions on questdb

QUESTION

What is a equivalent of a merge query(insert/update/delete) is present in the QuestDB?

Asked 2022-Feb-11 at 09:52

What is a equivalent of a merge query(insert/update/delete) is present in the QuestDB?

Below is an example for tsql. I would like to understand how to implement the same logic in QuestDB - insert rows for new data and update rows for existing data (if they changed)

https://www.sqlshack.com/understanding-the-sql-merge-statement/ USE SqlShackMergeDemo GO

MERGE TargetProducts AS Target
USING SourceProducts    AS Source
ON Source.ProductID = Target.ProductID

-- For Inserts
WHEN NOT MATCHED BY Target THEN
    INSERT (ProductID,ProductName, Price) 
    VALUES (Source.ProductID,Source.ProductName, Source.Price)

-- For Updates
WHEN MATCHED THEN UPDATE SET
    Target.ProductName  = Source.ProductName,
    Target.Price        = Source.Price;

ANSWER

Answered 2022-Feb-11 at 09:52

QuestDB (current v6.2) does not support any form UPDATE or DELETE statements at the moment. The only way to delete data is to drop a partition or truncate table. There is no equivalent for MERGE either.

This is going to change soon.

Source https://stackoverflow.com/questions/71077841

Community Discussions, Code Snippets contain sources that include Stack Exchange Network

Vulnerabilities

No vulnerabilities reported

Install questdb

You can install using 'pip install questdb' or download it from GitHub, PyPI.
You can use questdb like any standard Java library. Please include the the jar files in your classpath. You can also use any IDE and you can run and debug the questdb component as you would do with any other Java program. Best practice is to use a build tool that supports dependency management such as Maven or Gradle. For Maven installation, please refer maven.apache.org. For Gradle installation, please refer gradle.org .

Support

Community Slack: join technical discussions, ask questions, and meet other users!GitHub issues: report bugs or issues with QuestDB.GitHub discussions: propose new features or show what you've built.Stack Overflow: look for common troubleshooting solutions.

DOWNLOAD this Library from

Find, review, and download reusable Libraries, Code Snippets, Cloud APIs from
over 430 million Knowledge Items
Find more libraries
Reuse Solution Kits and Libraries Curated by Popular Use Cases

Save this library and start creating your kit

Explore Related Topics

Share this Page

share link
Reuse Pre-built Kits with questdb
Consider Popular Time Series Database Libraries
Compare Time Series Database Libraries with Highest Support
Compare Time Series Database Libraries with Highest Security
Compare Time Series Database Libraries with Permissive License
Compare Time Series Database Libraries with Highest Reuse
Find, review, and download reusable Libraries, Code Snippets, Cloud APIs from
over 430 million Knowledge Items
Find more libraries
Reuse Solution Kits and Libraries Curated by Popular Use Cases

Save this library and start creating your kit

  • © 2022 Open Weaver Inc.