An object that can generate integers.
0
votes
0answers
9 views
The InnoDB log sequence number is in the future
Our site was getting intermittent database errors and I asked my webhost to check what's happening. After some inspection they found that the database has few issues and tried repairing it. Finally I ...
-4
votes
2answers
91 views
What are the advantages of sequences in SQL Server 2012? [closed]
I upgraded my SQL Server 2008 R2 to SQL Server 2012, and I had noticed a new feature was added: Sequence.
I don't know the reason of adding sequences when there is an identity property.
Can someone ...
0
votes
2answers
23 views
How mysql process where condition
I have a query like
Select * from tbl1
WHERE
( price > 10
AND qty > 200
AND condition=1
AND name like '%abc%')
My question is how MySQL will process this? My concern is that I want ...
4
votes
2answers
110 views
Alternative to sequence and timestamp: uniquely ordering records in time
Oracle 11gR2 Exadata
I'm required to uniquely identify when records are created in time. Sequence caching means I cannot use a sequence-based ID and batching inserts means that all records inserted ...
0
votes
1answer
70 views
How to store a sequence of events related to a transaction
I am using Sql Server 2008 R2.
I have two tables that describe import processes and export processes.
Import table has these columns with others that just have details about each type of import
...
2
votes
1answer
133 views
Is it possible to re-initialize sequence
How do I re-initialize the sequence value without drop and recreating them again
For example, the current sequence value is 3, now I want to restart it with 1 again.
2
votes
1answer
182 views
Reset every Oracle sequence to the MAX value of its target table PK?
I finally got around to migrating from MySQL to Oracle and was pleasantly surprised just how well of a job the SQLDeveloper Migration tool did. It even took my AUTOINCREMENT fields and created ...
3
votes
2answers
123 views
Resetting a SQL Server 2012 sequence
I'm in the process of testing and populating a specific table that leverages the SEQUENCE object. In this process I'm testing populating the table with tens of thousands of insert lines (as I'm ...
2
votes
1answer
102 views
Generating an arithmetic sequence
I would like to generate a named table in a WITH clause which will contain this arithmetic progression:
╔══════════╗
║ mynumber ║
╠══════════╣
║ 0 ║
║ 30 ║
║ 60 ║
║ 90 ║
║ ...
0
votes
1answer
158 views
MySQL non-sequential primary key of certain length
what's the best way to create a non-sequential primary key of a certain length in MySQL?
I'm looking to use the primary key as a 'Pin' number which real actual human people can use to refer to the ...
3
votes
3answers
652 views
Using the same sequence twice in a PL/SQL statement
I wrote the snippet of PL/SQL today:
declare
first_id number;
second_id number;
begin
insert into table (sort_nr, text_id, unit_id) values(...,
table_seq.nextval, table_seq.nextval) returning ...
2
votes
1answer
178 views
Oracle sequence generation performance during persists of large data sets
In the context of an Oracle sequence, when persisting > 200 million records, is there a performance hit on the database if the sequence cache is the default value of 10000? That is to say does ...
1
vote
4answers
307 views
Limiting Generated Sequence Values in Multi-table Insert
In Oracle, given the following objects:
create table a (x number );
create table b (val number );
create table c (val number );
create sequence my_seq;
Suppose I populate table a as follows:
...
1
vote
1answer
272 views
Create unique numeric token on PostgreSQL
I have a database where I want to generate unique tokens of six numeric characters. These tokens should be generated each time an invoice number is inserted in the invoice_no column. This would mean ...
2
votes
4answers
151 views
What free database software support sequences
I have a requirement that a database must support sequences. I know oracle and PostgreSQL support it. Are there any other free database software that support database sequences? it would be great if ...
2
votes
2answers
863 views
Most efficient way to add a serial column to a huge table
What's the fastest way to add a BIGSERIAL column to a huge table (~3 Bil. rows, ~ 174Gb)?
EDIT:
I want the column to be incremented values for existing rows (NOT NULL).
I didn't set a fillfactor ...
0
votes
1answer
683 views
Best practices for ensuring up to date sequences after table import
We perform weekly table moves between several schema using expdp and impdp. Some tables have sequences associated with the ID columns and I'd like to ensure that the sequences are always up to date on ...
11
votes
3answers
2k views
How could sequence.nextval be null in Oracle?
I have an Oracle sequence defined like so:
CREATE SEQUENCE "DALLAS"."X_SEQ"
MINVALUE 0
MAXVALUE 999999999999999999999999999
INCREMENT BY 1 START WITH 0 NOCACHE NOORDER NOCYCLE ;
...
2
votes
1answer
231 views
Using the special Dual table to read sequences
It there a performance impact when using the dual table to read a sequence' nextval over an direct insert?
I'm currently optimizing the performance in a large IT system and what I've found is that ...
5
votes
1answer
565 views
Guarantee SQL Server Identity Columns that two consecutive values differ by constant increments?
I posed a question about Denali sequences here and another question about emulation of identity columns in Oracle Global Tables here.
I always thought that I could trust that identity values ...
8
votes
2answers
12k views
How do I use currval() in PostgreSQL to get the last inserted id?
I have a table:
CREATE TABLE names (id serial, name varchar(20))
I want the "last inserted id" from that table, without using RETURNING id on insert. There seem to be a function CURRVAL(), but I ...
20
votes
2answers
1k views
Why are Denali sequences supposed to perform better than identity columns?
In his answer to sql2005 whats better: identity columns or generated uinique id values?
mrdenny mentions, says
When SQL Denali comes out it will
support sequences which will be more
efficient ...
