database-design

What column data type should I use for storing large amounts of text or html

拟墨画扇 提交于 2020-01-20 13:33:27
问题 I have a column in a table which used to be varchar(255) in the beginning and due to some design changes now it is varchar(1536) = 1024 + 512. I will not be searching or indexing this field, does it make sense to store this value in a different data type other than a varchar if you would like to optimize this for performance? 回答1: Yes, it will be better if you can store the values in the " TEXT " data type. For more details, please read this article. Regarding knowledge of storage

What column data type should I use for storing large amounts of text or html

北战南征 提交于 2020-01-20 13:32:58
问题 I have a column in a table which used to be varchar(255) in the beginning and due to some design changes now it is varchar(1536) = 1024 + 512. I will not be searching or indexing this field, does it make sense to store this value in a different data type other than a varchar if you would like to optimize this for performance? 回答1: Yes, it will be better if you can store the values in the " TEXT " data type. For more details, please read this article. Regarding knowledge of storage

What column data type should I use for storing large amounts of text or html

狂风中的少年 提交于 2020-01-20 13:32:48
问题 I have a column in a table which used to be varchar(255) in the beginning and due to some design changes now it is varchar(1536) = 1024 + 512. I will not be searching or indexing this field, does it make sense to store this value in a different data type other than a varchar if you would like to optimize this for performance? 回答1: Yes, it will be better if you can store the values in the " TEXT " data type. For more details, please read this article. Regarding knowledge of storage

What column data type should I use for storing large amounts of text or html

 ̄綄美尐妖づ 提交于 2020-01-20 13:32:24
问题 I have a column in a table which used to be varchar(255) in the beginning and due to some design changes now it is varchar(1536) = 1024 + 512. I will not be searching or indexing this field, does it make sense to store this value in a different data type other than a varchar if you would like to optimize this for performance? 回答1: Yes, it will be better if you can store the values in the " TEXT " data type. For more details, please read this article. Regarding knowledge of storage

Select all rows that have at least a list of features

大憨熊 提交于 2020-01-20 08:48:07
问题 I have EXPERIMENTAL_RUNS (runId), each of which have any number of SENSORS (sensorId) associated with them. With that in mind, I have an RS table to join the two: ========== RS ========== runId, sensorId Thus if the run with runId=1 had sensors with sensorId=1, sensorId=6, sensorId=8 in it, there would be 3 entries in the RS table: (runId=1, sensorId=1) (runId=1, sensorId=6) (runId=1, sensorId=8) Is this really how I would return all EXPERIMENTAL_RUNS that have sensors {11,13,15}? From what I

Database table design for scheduling tasks

流过昼夜 提交于 2020-01-19 23:15:46
问题 I want to be able to create schedules that can be executed based on a fixed date, repeated daily, repeated on a particular day of the week, repeated on a particular month of the year, repeated on a particular date every year, and repeated at a particular time of the day. Please how do i go about building the database tables for this problem? Edit #1 Basically, i'm writing an application that allows users to schedule pre-configured greetings to be sent at various pre-configured times. I know i

Database schema for managing addresses

不问归期 提交于 2020-01-17 14:47:25
问题 I am developing a MVC project with sql server. in which each user will be given a username after registration. Registration is done using various data like address and email number and phone number. I am using a table to store address and its id is stored in users table. Now as people can have change address so I'm not able to understand it how to manage it. I want to keep the old address as well as new for new users. Can anybody help? 回答1: You have some options: In address table, add userid

First Database Structure help Please

本秂侑毒 提交于 2020-01-17 09:40:51
问题 This is my first time making my own mysql database, and I was hoping for some pointers. I've looked through previous questions and found that it IS possible to search multiple tables at once... so that expanded my posibilities. What I am trying to do, is have a searchable / filterable listing of Snowmobile clubs on a PHP page. These clubs should be listable by state, county or searchable for by name / other contained info. I'd also like them to be alphabetized in the results, despite the

ERD draft for creating grouped data collection list

我与影子孤独终老i 提交于 2020-01-17 08:25:09
问题 This is a follow up question for Table design about sets of data collection elements as I am still trying to come up with a design. What I would like to do is to be able to pre-define what study/protocol pair requires as a data collection to be displayed like a to-do list or checklist which can be tracked at clinic visits for patients. Attached is what I have so far with possible examples in each table but I have never implemented supertype/subtype relationship so I am not sure if I am on the

How to structure a database schema to allow for the “1 in a million” case?

谁说胖子不能爱 提交于 2020-01-17 05:52:08
问题 Among all the tables in my database, I have two which currently have a Many-to-Many join. However, the actual data population being captured nearly always has a One-to-Many association. Considering that I want database look-ups (doctrine queries) to be as unencumbered as possible, should I instead: Create two associations between the tables (where the second is only populated in these exceptional cases)? Change the datatype for the association (eg to a text / tinyblob ) to record a mini array