Open Source RDBMS - Seamless, Scalable, Stable and Free

한국어 | Login |Register

author
message
[Level:0]dragosh_r0ck

Post subject: unload/load issue

registered: 09/08/2012

IP: *.96.215.239

views: 3

After a successful unload/load operation I noticed something strange regarding the order of the records in a table:

- from development server

devel_table.jpg


- from the production server

production_table.jpg


The records come in the reverse order. Why is that?


Thanks,
Dragos


Attachment:

Quote
[Level:8]CUBRID

# Post subject:Re: unload/load issue

profile

registered: 03/29/2010

IP: *.181.249.254

Hi Dragos,

CUBRID does not keep records in a specific order. It puts them according to how it finds space for the entries. That's why if no "ORDER BY" is specified, the records may appear in different order in different databases.

Best regards,

The CUBRID Team

Quote
[Level:0]dragosh_r0ck

# Post subject:Re: unload/load issue

profile

registered: 09/08/2012

IP: *.96.215.239

So, using unload/load I cannot preserver the records order, right? But if I want this, what are the steps to be followed?

Thanks,

Dragos


Quote
[Level:8]ginarrbrik

# Post subject:Re: unload/load issue

profile

registered: 11/08/2011

IP: *.181.249.254

Use order by in queries. This is the only way to ensure an order for select queries. Add indexes for the columns that you're using for ordering and everything should be ok.

Quote
[Level:0]dragosh_r0ck

# Post subject:Re: unload/load issue

profile

registered: 09/08/2012

IP: *.96.215.239

I understand, thanks.

Quote
[Level:8]CUBRID

# Post subject:Re: unload/load issue

profile

registered: 03/29/2010

IP: *.181.249.254

One way to keep the order of the records is to use this approach: 

1. Export all tables from a database in SQL format for example (other formats are available also);

2. Delete the records from the tables in the database where you want to copy the records to

3. Import all SQL files (one will be created for each table) in the other database.

Optionally, if no tables exist in the destination database, you must export the schema of the first database also and import it into the second database.

Quote
[Level:0]dragosh_r0ck

# Post subject:Re: unload/load issue

profile

registered: 09/08/2012

IP: *.96.215.239

I will try this.

Thanks!

Quote




You are either using a very old browser or a browser that is not supported.
In order to browse cubrid.org you need to have one of the following browsers:



Internet Explorer: Mozilla Firefox: Google Chrome: