|
I need to store posts from users.
Their usernames are unique and I'm sure they can't make posts at the same millisecond.
Then the URL of their post would contain /Username/12345678890/title-of-the-post
I can't use the Auto_Inc number as I don't know it...
Started by Daxon on
, 4 posts
by 4 people.
Answer Snippets (Read the full thread at stackoverflow):
If they can post from different PCs, you should make sure that the server says what the current time is (user PCs can quickly... .
Unless different people can login using the same username from different PCs, username + time in milliseconds should be enough .
|
|
What is the difference between mysql unique and non-unique index in terms of performance? Let us say I want to make an index on a combo of 2 columns, and the combination is unique, but I create a non-unique index. Will that have any significant effect...
Started by Sanjay on
, 3 posts
by 3 people.
Answer Snippets (Read the full thread at stackoverflow):
As far as a primary key is concerned, probably quite, because it means that it won't... .
On a non-unique index that just happens to be unique and a unique index? I'm not sure, but I'd be the number of rows, for a unique index).
|
|
Hi,
I have a table with a column of unique string values. The max length of the string value is 255 char. I want to generate a unique id with the string value as input. In other words I am looking for a compact representation for a string. The unique ...
Started by pkrish on
, 8 posts
by 8 people.
Answer Snippets (Read the full thread at stackoverflow):
How unique is "unique"? Using any java.security.MessageDigest....
If your database requires that the column contain unique the original, a hash function such as MD5 is what you're looking for.
Constraints on it than "be unique".
|
Ask your Facebook Friends
|
I need for function to generate a UNIQUE string, like:
DIM uniStr as string = generateUniStr()
is there any function already do this ?
Started by turki2009 on
, 3 posts
by 3 people.
Answer Snippets (Read the full thread at stackoverflow):
You can use
Dim uniStr = Guid.NewGuid().ToString().
You might want to give more details on what you're really looking for, because it's likely there's a better solution .
You can gen up a GUID and stringify it.
|
|
Is there a better way than what is proposed here to create a one-to-one mapping between an table view cell's NSIndexPath and a unique NSUInteger or int , in order to create a unique tag property value for a widget in the cell (a UIProgressView )?
The ...
Started by Alex Reynolds on
, 3 posts
by 3 people.
Answer Snippets (Read the full thread at stackoverflow):
(if ....
If you have a table with 2 sections, each with 3 billion rows, then there's no way to map those 6 billion potential NSIndexPaths into the 4 billion 32-bit NSIntegers .
No, there really isn't a way that is guaranteed to work for any number of rows .
|
|
I'm working on an application that will be implementing a hex value as a business key (in addition to an auto increment field as primary key) similar to the URL id seen in Gmail. I will be adding a unique constraint to the column and was originally thinking...
Started by tgm on
, 4 posts
by 4 people.
Answer Snippets (Read the full thread at stackoverflow):
A potentially larger problem ....
Is your hex value a GUID? Although I used to worry about the performance of such long items as indexes, I have found that on modern databases the performance difference on even millions of records is fairly insignificant .
|
|
My need is to have items in kind of Collections.Generic.Dictionary where I can get a struct by it's id as a key. Then I have need to fetch many structs, say 1% or less of all items, by another field. Like a cursor by an non-unique index. With Dictionary...
Started by matti on
, 4 posts
by 4 people.
Answer Snippets (Read the full thread at stackoverflow):
You had:
class Employee { int DeptID; // A non-unique field we want to index; }
I don't believe there is a built in Dictionary like collection accepting non-unique TKey values, but you.
|
|
Is a GUID unique 100% of the time?
Will it stay unique over multiple threads?
Started by David Basarab on
, 13 posts
by 13 people.
Answer Snippets (Read the full thread at stackoverflow):
It is based on both hardware....
Yes, a GUID should always be unique.
From Wikipedia.
While each generated GUID is not guaranteed to be unique, the total number of unique keys (2^128 then have 6.8×10^15 universally unique GUIDs.
|
|
Since, guid values will always be unique anyway why use a unique index. Isnt it true that when you use a unique index that it slows down inserts?
Answer Snippets (Read the full thread at stackoverflow):
While a unique constraint may not be too useful if you are certain that the data is going to be unique, a unique index will create an actual "index" of that column that column....
Of a unique constraint and a unique index.
|
|
If I have a table as follows:
ID | Name | Category | Parent | URL | LastModified
If two rows have the same Name and parent, then they are not unique. How do I get the unique set of rows in this case (but return more than the columns that make them unique...
Started by Donaldinio on
, 5 posts
by 5 people.
Answer Snippets (Read the full thread at stackoverflow):
If, though, you want to include non-unique/parent combination
If you're looking....
If you want to not have them in the result, even though there will only be one row per Name and Parent .
It depends on what you want to do with non-unique rows.
|