Questions tagged [database-optimization]
186 questions
0
votes
3 answers
Optimize group by used along with where condition in mysql
I have a table with around 8M rows and 35 columns(1G in size overall). This is used for reporting that involves multi-level group by conditions. Here is one such query.
explain select min(a), max(a), avg(a), sum(b) from test where (c=2 or c=20 or…
azi
- 859
- 1
- 11
- 28
0
votes
2 answers
Django - very slow query
I've made a module which parses xml file and updates or creates data in django db (pgsql).
When the data import/update is done I try to update some meta data of my objects.
I use django-mptt for tree structures and my meta-data updater is for…
Efrin
- 2,153
- 2
- 20
- 43
0
votes
1 answer
Does indexing fields for views give any performance increase on MySQL?
So does adding indexes to tables that are in a view give you any performance boost. Let's say we have following tables:
CAR
ID (pk)
model
owner
TYRES
ID (pk)
carID
size
CAR_DETAILS (view)
carID
owner
model
tyreSize
View is joined on…
Firze
- 3,283
- 4
- 41
- 58
0
votes
5 answers
I can store a lot of data (<=4GB) in one table column. But is it a good idea?
To make a long story short, one part of the application I'm working on needs to store a somewhat large volume of data in a database, for another part of the application to pick up later on. Normally this would be < 2000 rows, but can occasionally…
vonconrad
- 24,377
- 7
- 65
- 69
0
votes
2 answers
How can we optimize this linq to entity query to decrease the response time?
IQueryable mySearch =
eventDC.GetBooks()
.Where(p => p.Price.Any(d => d.EventDatetime.Month == fromDate.Month
&& d.EventDatetime.Year == fromDate.Year))
.WithGroup(groupId)
…
MemoryLeak
- 7,036
- 22
- 80
- 127
0
votes
1 answer
Better way to reference foreign key in database
can you suggest the best practices for database optimization?
Here is my database schema,
group(id, name, status)
users(id, group_id, parent_id, username, password)
company(id, name, address, phone)
agent(id, agent_code, name, address, phone)
In…
Dipendra Gurung
- 4,972
- 11
- 34
- 55
0
votes
2 answers
Optimize large and gradually increasing database
I am about to create a PHP web project that will be consisting of a large database. The database will be MYSQL and will store more than 30000 records per day. To optimize the DB I thought to use MEMCACHED library with it. Am i going the correct way…
Divyang
- 51
- 2
- 9
0
votes
1 answer
Query Optimization on Searching
I am trying to create a search query for developing a school library that will retrieve data from the database with a low cost. Inside my table are callNumber,author,title and year. I want to search from callNumber, author and title.
$sqlCommand =…
0
votes
3 answers
How to save one Doctrine entity to two database tables (required for MySQL optimisation)
In my database I've a table file and a table file_content. The file table stores the metadata of the file such as name, mime and some more. The file_content stores a blob with the file content. I'm not storing the blob in the same table as the…
nielsr
- 2,177
- 2
- 12
- 16
0
votes
1 answer
MySQL performance of select a large set of data in a table
I have a question about MySQL optimization. Assume that there have a table market_transition with 1,000,000 data rows. Is there have any performance issue that if i do SELECT * FROM market_transition WHERE end_time >= (SOME TIMESTAMP) and it return…
Chris
- 39
- 5
0
votes
1 answer
MongoDB - Geospatial intersection performance
We are developing a small tool that will allow a person to draw a polygon on a Google Map, and it will return zip codes that overlap the drawn overlay(s). I figured this would be a great time to dive into a NoSQL database, since I've heard great…
Keith
- 5,100
- 3
- 31
- 48
0
votes
1 answer
What is the most elegant way to do Concurrency Control of modifying records in Mysql?
Ok, look at this scenario, I got a table in which users may modify many rows at the same time. I want that when someone is modifying records then other people can't modify the same record. Ex, there's table1 with 3 columns (ID, text,…
Tum
- 3,554
- 5
- 33
- 62
0
votes
3 answers
Database for microblogging startup
I will do microblogging web service (for school, so don't blast me for lack of new idea) and I worry that DB could be often be overloaded (user could following other users or even tag so I suppouse that SELECT will be heavy - check 20 latest…
IProblemFactory
- 8,777
- 5
- 44
- 62
0
votes
2 answers
Should we store the Text & the Tag of an HTML String into 1 same column or into 2 seperate columns?
I want to store the following HTML string into DB This is my text. There are 2 parts of this Html string:
The Text: "This is my text"
The Tags: , , ,
In my opinion, there are 2 options to store the above Html…
Tum
- 3,554
- 5
- 33
- 62
0
votes
1 answer
Database design - how to structure
Currently, I have one table, and it is getting populated very fast.
I have 50 devices. I gather data from each device every 30 seconds. Therefore, after we add 10,000 devices, they would generate 876,000,000 records per month-- which is a…
Andrew
- 7,095
- 13
- 55
- 109