Skip to main content

New answers tagged

0 votes

Designing a schema with non-enumerable, unpredictable public ids in MySQL

The closest thing to a common solution you're looking for is to use a UUID for the primary key. This isn't a universal solution, because UUID's have pros and cons. But it's a pretty common solution.
Bill Karwin's user avatar
  • 15.2k
-2 votes

Database Design for Attendance Management

PostgreSQL handles 50 million records per table with ease.
user482745's user avatar
1 vote
Accepted

What impact has uniqueness constraint jsonb on postgres db performance

I'll ignore the "why" question. Look at the pgsql-hackers archives; it is all open source. You need a B-tree index for a unique constraint. Putting the index directly on the JSON column is ...
Laurenz Albe's user avatar
0 votes

SQL Server Management Studio "Key cannot be null" error when giving a specific user permissions on Stored Procedures

The problem was that the stored procedures had Writes written into them, and the user was a Read Only account. This error doesn't really point to that, but make sure the user has permissions to ...
LYNITS's user avatar
  • 1
1 vote

RDBMS vs NoSQL decision making

For what it's worth, you're generally right here - but things are changing. Historically the idea of large datasets (particularly with huge unstructured data types) being not well suited for ...
Ged Freund's user avatar
0 votes

Manage the amount of data on tables

10M rows/year is less than 1/sec. 100 simple queries per second is not a problem What do the SELECTs look like? If they are getting slower and slower, then they are probably doing "table scans&...
Rick James's user avatar
  • 78.6k
0 votes

in Relational database, will index accelerator query: select count(*) from table where score >= number

select count(*) from table where score >= number will always use INDEX(score) -- Because the query can be done entirely in the index ("covering"). How much faster will it run? That ...
Rick James's user avatar
  • 78.6k
0 votes
Accepted

How do model different logical views on data

You need to make set have a FK on machine, and this should be a secondary composite unique key along with its main primary key. create table "set" ( id serial not null primary key, ...
Charlieface's user avatar
  • 13.7k
0 votes
Accepted

Can you have a minimal transactions data warehouse?

What you describe is basic data warehouse architecture, where you have both normalized transaction data, and from that load tables that are modeled for easy consumption and fast query performance. In ...
David Browne - Microsoft's user avatar
-2 votes

Using internal or external ids when storing external data

Having written many applications with such databases, I would always use your internal id within the database. There are several reasons (not all will apply to you) The internal id is smaller and ...
Rohit Gupta's user avatar
  • 1,686
-2 votes

Can you have a minimal transactions data warehouse?

Your question is a classic example of the generic question: ‘A’ doesn’t work. Should I replace it with ‘B’? Who knows? It depends entirely on why ‘A’ does not work how you expect. If ‘A’ doesn’t ...
OldFart's user avatar
0 votes

Designing a data model to handle both recurrence and nested dependencies

Personally I think you’d make your life much easier by finding a “project management” application that meets your needs. I’m sure that there are web-based ones, as well as standalone ones. A project ...
OldFart's user avatar
1 vote

Mysql problem not valid syntax

Column name тип травмы has a blank (space) in it. That is not allowed. The most common solution is to replace the space by an underscore, like this: тип_травмы Another option is to use a quoted ...
Albert Godfrind's user avatar
0 votes

Efficient way to store and retrieve big amount of data

You have different options to try to improve this solution. First, if TimescaleDB with partitioning is inefficient for searching, you can try a different way for partitioning with smaller data sets. ...
Severalnines's user avatar
1 vote

Questions get answered by a user, how to store historical data alongside the answer?

Now what if someone changes a question or category name later, I need to store the historical data of the question/category alongside the answer. No, having this stored alongside the answer would ...
Giannis Tsimarakis's user avatar
0 votes

in Relational database, will index accelerator query: select count(*) from table where score >= number

To add on top of Phill’s answer above/below, we could add that the way MySQL checks the cardinality of the index (how many different distinct values are stored in the column) is somewhat peculiar. As ...
Severalnines's user avatar
-1 votes

Is it necessary for a foreign key to be a primary key in another table? Why?

Actually, a foreign key may reference a unique key which allows NULLs that's why it is best for the child table to have the PK/FK on the same column.
William's user avatar
0 votes

in Relational database, will index accelerator query: select count(*) from table where score >= number

An index might improve this query, as long as the values of score are a suitably good discriminator ("way of picking out rows"). If you have 99.9M rows with a score of zero and 100K with a ...
Phill  W.'s user avatar
  • 8,915
0 votes

Question related to Database Design in SQL Server

resulting in a not so optimal performance How so? If I'm inferring the situation correctly, you'd probably want to have on Product: PRIMARY KEY CLUSTERED (ApplicationId, IsDisabled, ProductId) This ...
Steve's user avatar
  • 549
0 votes

Multiple parents for AspNetUsers table for Asp.Net Core 3.1 app

To have multiple parent ids you can use a Bridge table see the shortened first example. so you have multiple parent even more than 2. The second sample a user can only have 2 parents, and the must be ...
nbk's user avatar
  • 8,490
0 votes

ideas to reduce association tables while building a data warehouse

The first question you need to ask yourself is what is/are your fact table(s). In other word, what are the events you want to report on? Maybe the action of installing a firmware on a device is your ...
JeromeFr's user avatar
  • 289
3 votes
Accepted

Transactional Replication - how to set up alerts/notification to send alerts before transaction log space is full on a Publisher?

How can i get alert before my publisher's t-log space is full due to any issue in replication what alerts should I use which will tell me that the log-space is getting full on publisher? You can use ...
Aleksey Vitsko's user avatar
2 votes

Transactional Replication - how to set up alerts/notification to send alerts before transaction log space is full on a Publisher?

How can i get alert before my publisher's t-log space is full due to any issue in replication. It depends on how your transaction log file growth is set up. If you have pre-grown your transaction log ...
SqlWorldWide's user avatar
  • 13.5k

Top 50 recent answers are included