All Questions
Tagged with performance sql
244 questions
3
votes
1
answer
136
views
Faster Query to Track State changes in a Large Table
I have a table that tracks state changes of an entity with timestamps. The schema of the table is as follows:
entityid
userid
originalvalue
newvalue
changetime
255
101
Draft
Submitted
2023-11-28 12:10:...
2
votes
1
answer
93
views
Determining the least dangerous tags with over 1K answers to answer
So I thought I'd take another shot at making a SEDE query after being somewhat inactive after a while.
Essentially what this does is that it takes the tags that have at least 1000 answers for that tag ...
6
votes
1
answer
909
views
Show how close a user is to being unsung
So this morning, I decided to create a SEDE query that answers the age-old question "How close am I to being Unsung?" because I recently polished up my first SEDE query and I realized that I ...
2
votes
1
answer
250
views
MySQL interval search query suggestions
My database structure is:
...
3
votes
3
answers
120
views
Improving efficiency of database searches under SQLite (SpatiaLite - QGIS)
I'm new to SQL, but I've always heard that it's a very efficient way of searching databases. For the same task, in VBA I get a result in a few seconds for 1000 queries. In SQL it takes several minutes....
0
votes
1
answer
45
views
Find and conditionally sort all venues matching a filter provided by an API client in PostgreSQL
I have an API where users can retrieve a list of "venues".
Every venue is a profile, but not every profile is a venue
Venues can be "parents" of other venues (think hotel - floor -...
-1
votes
1
answer
252
views
Optimizing LINQ Query on C# Web API
Can someone help me optimize this code especially the LINQ query. It takes 8-12 seconds just to return a response when I'm calling the endpoint. Its super slow, and my whole endpoint call is taking ...
3
votes
1
answer
86
views
calculating the percentage of distribution of ids per Loc for each country
Which of the two queries is theoretically better and why?
I would like to understand why query 2 takes longer although there is no relevant information in the Execution Plan.
I'm querying a Presto ...
1
vote
1
answer
81
views
Query for sequential column permutations in SQLite
For dummy's sake, let's say that I have a database with columns text, ind and sentid. You ...
1
vote
3
answers
190
views
SQL query joining applications to categories
I do have large database and my query takes about 2s to complete on production environment which is kinda slow and would like to ask is there a space for improvement?
My initial inputs are ...
2
votes
1
answer
178
views
Prevent Column Name Collision
I have been working on a series of posts about a library to connect to databases but most of the scenarios I have to resort to some "JOIN" the problem arose when two or more tables had some ...
0
votes
2
answers
45
views
Table-Value Function with row-level-locking
I'm implementing row-level-locking on a MS SQL Server. The function I created below works, but even with a very small data set, it takes a significant amount of time to return the results.
If I were ...
4
votes
3
answers
2k
views
Optimizing the insertion of 400 000 records in sqlite
I have the python script that creates a sqlite database and fills it with data (originally coming from a json file). At the time I execute the code below, my word ...
3
votes
2
answers
372
views
Archiving / Moving Data from one database server to another database server
I am working on an SMS marketing project based on Yii2 Framework (PHP 7.3 & MariaDb (innodb engine)) where we have to move the logs from different tables to the archive db, which is total a ...
2
votes
1
answer
72
views
Query to retrieve available stock
I have a query that outputs a list of products with some fields from other tables. That query works fine.
Now, I'm attempting to retrieve the available stock for each product in that list. I'm not ...