Skip to main content

Questions tagged [time]

The tag has no usage guidance.

15 questions with no upvoted or accepted answers
Filter by
Sorted by
Tagged with
2 votes
0 answers
138 views

Why do queries on two tables with the same structure have different execution times

I have partitioned a large table in a PostgreSQL database into monthly child tables with the same structure and similar numbers of rows. Recently I have noticed that the newer tables take much longer (...
Kat's user avatar
  • 21
1 vote
0 answers
59 views

Time of last insert into table in PostgreSQL v16

I am testing new features of PostgreSQL v16. I see two new columns are added to system tables: pg_catalog.pg_stat_all_tables.last_seq_scan - records last sequential scan pg_catalog....
folow's user avatar
  • 401
1 vote
0 answers
407 views

Resample time series in SQLite

I have following table: CREATE TABLE entries ( utc TEXT, entry INTEGER ); with following data: INSERT INTO entries (utc, entry) VALUES ('2022-10-01 01:54', 23), ('2022-10-04 02:40', 46), (...
adius's user avatar
  • 113
1 vote
0 answers
59 views

How can I generate bar chart values for some time series data in postgresql?

I have a 'log' table which has two columns user_id and a ts (timestamp value of activity event for user): I can use the following query to get a list of each user_id and their last activity event: ...
Chris Stryczynski's user avatar
1 vote
1 answer
49 views

calculate days spent of all visitors from encounters

I have an encounters table CREATE TABLE visitors( id serial PRIMARY KEY, start_date TIMESTAMP NOT NULL, -- visitor_id bigint NOT NULL -- skip for now, end_date TIMESTAMP ); (end_date can be ...
Radio Active's user avatar
1 vote
1 answer
817 views

How to reduce redundant time-series data in MySQL into a function?

i have a question that actually does not fit here very much, but maybe it fits. So, i have data like this: How can i reduce this 3 entries with same values? Sure, i can just delete the other 2, but ...
Rep's user avatar
  • 11
1 vote
0 answers
287 views

Is there a faster way of importing 8m+ rows?

I'm creating a new feature on my website in order to provide player locations (my website is for a multiplayer gaming service), and am going to use a simple IP lookup in my database. For this I need ...
AStopher's user avatar
  • 111
1 vote
0 answers
157 views

Time series data and utc conversion

I'm storing data in minute, hour, day, month and year buckets. All data is stored in UTC. Let's assume a client is in PDT time (-07:00 UTC) If the client wants to query for the hour sum of 4/23/2016 ...
James Fazio's user avatar
1 vote
0 answers
37 views

Heirarchial Database with Time Tracking

Working in Python/Django 1.8 I have a problem along the following lines: Assembly Table |Part |Parent (FK to other Part) i.e.: Car |--Tire |--Bolt A |--Bolt B Journey Table |Date |...
MikeFoxtrot's user avatar
0 votes
0 answers
95 views

Keep both non-overlapping intervals and overlapping ones with a larger id MySQL

I have the following table in MySQL: data(interval_id, object_id, start, end), where interval_id, object_id are integers and interval_id is unique per every object_id, while object_id itself is unique....
Alex.Kh's user avatar
  • 101
0 votes
2 answers
60 views

How I do I aggregate or perform calculations on a time datatype in "MM:SS:MS" in MySQL?

I'm currently working on an NBA project and I need to take the average minutes played per player, but I have no idea how to aggregate or calculate the time datatype. I know you have to convert it, but ...
thisisforfun's user avatar
0 votes
1 answer
90 views

Why does MariaDB execution time is doubled for the same query (LOAD DATA INFILE)?

I observed a strange behaviour regarding the execution time of a query to import a CSV file in an empty table created beforehand. The query execution time to import the file increases while repeating ...
GiorgioAbitbolo's user avatar
0 votes
0 answers
26 views

Time difference is not returning the expected result in PostgreSQL

select '06:00:00'::TIME - ('19:00:00'::TIME - '07:00:23.388471'::TIME); +-----------------+ | ?column? | |-----------------| | 18:00:23.388471 | +-----------------+ SELECT 1 Time: 0.012s Why ...
Ουιλιαμ Αρκευα's user avatar
0 votes
1 answer
126 views

Same server, same query, different response time

I have a development server that has some problem to access the data, user reporting that it's too much slow sometimes. The setup is: * virtual server; * 4 virtual CPU; * 8 GB of virtual memory ; * ...
Elleby's user avatar
  • 21
-2 votes
1 answer
827 views

Database design for a timesheet app?

I'm designing the database schema for a time tracking application and I need a little piece of advice. The application must permit the user: To enter for each day of the week the amount of time he ...
Zakaria Naji's user avatar