Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 3 years ago.
Improve this question
In SQL Server we have Index Seek operator. Which works very well for a search operation.
How much operation SQL Server needs to perform in order to get a value? I assume that it should be the height of the tree.
Nobody can say the one answer for sure because it depends on many parameters :
Index type (Clusted, None Clustered)
Unique or Not
Null or Not Null
Expected rows stored in which page
So, there is the well-explained article about index seeking [O2] blow:
https://sqlserverfast.com/epr/index-seek/
Related
Closed. This question is opinion-based. It is not currently accepting answers.
Want to improve this question? Update the question so it can be answered with facts and citations by editing this post.
Closed 6 days ago.
Improve this question
I have this requirement where I need to dump a large array of user Ids in one of the columns of a table in PostgreSQL DB. Let's say the max number of user Ids would be 100,000 and each user Id is of max 50 characters length. I won't be performing any operations on that table, it is just for logging purpose.
I've used text[] type column to dump those array of user Ids. I don't know if its the best way to do. I'm worried that some "max size limit reached" error gets thrown if the length of the array increases in the future.
Please suggest a better way to achieve this :)
Closed. This question is opinion-based. It is not currently accepting answers.
Want to improve this question? Update the question so it can be answered with facts and citations by editing this post.
Closed 4 years ago.
Improve this question
Sometimes I want to name a field in a table and this field is composed of a number of syllables!
I wonder how to select the most meaningful name in that case.
For example:
number of successions.
number of weekends
Should I write it:
NumberOfSuccessions
NumOfSuccessions
NumberSuccession
SuccessionNumbers
I care about my attribute naming because I'll deliver this to another developer and I want to get it smoothly.
You should select the first one, i.e. "NumberOfSuccessions" as that looks neat. It is always good to avoid short forms and keep the name as simple as plain english, wherever possible. Also avoid spaces as you have already done, just to make life simple.
Closed. This question is opinion-based. It is not currently accepting answers.
Want to improve this question? Update the question so it can be answered with facts and citations by editing this post.
Closed 7 years ago.
Improve this question
I am designing a database. I want to define a automatic sequence on a table primary key field. what is the best solution for it?
I know I can enable identity property for a field, but it has some problems ( for example its seed jumps on restart and unsuccessful events)
I also can use some calculated sequences. for example I can calculate max of the filed values and after incrementing use it as key for new inserted record.
which one is better? Is there another solution?
To my mind there's 3 options:
Identity - the simplest, but can have gaps when server is restarted etc.
Sequence - separate object, you will have still gaps in case of rollback
A separate table for the numbers - you won't have gaps, but it can be a hotspot that can cause blocking.
Closed. This question needs details or clarity. It is not currently accepting answers.
Want to improve this question? Add details and clarify the problem by editing this post.
Closed 7 years ago.
Improve this question
Can someone tell me what is missing in the second Pivot example. It returns NULL http://sqlfiddle.com/#!3/2b405/2
This is the literal answer:
There is no Car, Truck or Bicycle in your vehicle_parameters table. Nothing is missing in your statement, your result of NULL is correct.
Here are some other samples of PIVOT you may want to look up: https://technet.microsoft.com/en-us/library/ms177410%28v=sql.105%29.aspx
I think they explain dealing with nulls well.
Closed. This question needs details or clarity. It is not currently accepting answers.
Want to improve this question? Add details and clarify the problem by editing this post.
Closed 9 years ago.
Improve this question
This question is out of pure curiosity.
Why do some systems and frameworks adopt a suffix on table and/or column names?
Example: the Activiti framework for business process uses the _ character at the end of every column name (ID_, VERSION_, NAME_, ...). I have notice that in some other systems as well.
I'm sure there is a good reason for that.
This is a convention for using names that can be saved words. When you want to call column "from" you can use "from_" because "from" is saved word of SQL.