All Questions
78 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
250
views
MySQL interval search query suggestions
My database structure is:
...
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
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 ...
2
votes
2
answers
52
views
Querying nearest city with a given shop using latitude and longitude is slow
I am using the following query to search for the nearest city to my location from the cities table using latitude and longitude. The query also checks whether the nearest cities to my location have ...
1
vote
1
answer
175
views
Search by parameters from multiple tables
I wrote a query that searches people based on search parameters from 3 other tables (phones, ...
0
votes
2
answers
79
views
Improving/ Optimizing Performance Query in MySQL PHP
I have invoices, invoices_items, order, order_items. <...
2
votes
0
answers
72
views
Calculating effective shop inventories (SQL)
This is an SQL version of that question.
Shops and groups
The problem domain is a collection of shops (identified by an int shop_id number) each of which is ...
11
votes
1
answer
339
views
Science Fiction Wall of Fame (Shame?)
I have a few of hobbies, one is reading science fiction and fantasy and another is coding solutions. I thought I might have a chance to combine both hobbies on this project.
I have well over 1500 ...
6
votes
1
answer
5k
views
Fastest way to insert rows in mysql vs sqlserver (large dataset)
I'm looking for any possible improvements that could be made to run the mysql piece of code faster.
I created a simple test winform application that creates two docker databases :
Sqlserver on linux ...
1
vote
1
answer
36
views
Classifying counts of repeat visits per user for a website
I am trying to get number of times (or sessions) a user re-visited the website.
What I'm trying to find out-
Get the total number of users, number of sessions in the last 30days. I need to a pie ...
1
vote
1
answer
63
views
MySQL query to select number of fields occurring more times than x
I want to find out the 'rank' of a word in any given language. A word with a rank of 1 means it's the most commonly used word in the language.
There are two MySQL ...
4
votes
1
answer
167
views
PHP Laravel function to search for ads in MySQL
I am new to the Laravel framework. I have recently written a function which gets called through a route. The function is created for two purposes:
Get ads from a particular city based on provided ...
3
votes
2
answers
212
views
Program for entering 1000 random numbers into two different databases, one for odd numbers and one for even
I have created a program in java for entering 1000 random numbers into two different database one for odd numbers and one for even. The code is executing fine but it takes nearly a minute to execute. ...
5
votes
2
answers
135
views
Determine number of times an id was used with a domain IP
This is a slow query and the table has 50 million rows.
Table named 'log':
...