Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 816481
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 15, 20262026-05-15T01:50:16+00:00 2026-05-15T01:50:16+00:00

A table in Sybase has a unique varchar(32) column, and a few other columns.

  • 0

A table in Sybase has a unique varchar(32) column, and a few other columns. It is indexed on this column too.

At regular intervals, I need to truncate it, and repopulate it with fresh data from other tables.

insert into MyTable  
  select list_of_columns  
  from OtherTable  
  where some_simple_conditions  
  order by MyUniqueId  

If we are dealing with a few thousand rows, would it help speed up the insert if we have the order by clause for the select? If so, would this gain in time compensate for the extra time needed to order the select query?

I could try this out, but currently my data set is small and the results don’t say much.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-15T01:50:17+00:00Added an answer on May 15, 2026 at 1:50 am

    With only a few thousand rows, you’re not likely to see much difference even if it is a little faster. If you anticipate approaching 10,000 rows or so, that’s when you’ll probably start seeing a noticeable difference — try creating a large test data set and doing a benchmark to see if it helps.

    Since you’re truncating, though, deleting and recreating the index should be faster than inserting into a table with an existing index. Again, for a relatively small table, it shouldn’t matter — if everything can fit comfortably in the amount of RAM you have available, then it’s going to be pretty quick.

    One other thought — depending on how Sybase does its indexing, passing a sorted list could slow it down. Try benchmarking against an ORDER BY RANDOM() to see if this is the case.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm familiar with Sybase / SQL server, where I can create a temp. table
OK, so Sybase (12.5.4) will let me do the following to DROP a table
table data of 2 columns category and subcategory i want to get a collection
The table doesn't have a last updated field and I need to know when
My table structure looks like this: tbl.users tbl.issues +--------+-----------+ +---------+------------+-----------+ | userid | real_name
create table person ( name varchar(15), attr1 varchar(15), attr2 varchar(1), attr3 char(1), attr4 int
For DB2... table1.a is varchar(30) and has an index on it. table2.b is varchar(45)
I'm using Sybase 12.5.3, and want/need to do regex pattern matching. The Sybase help
We have an user table which the userId is an uniqueidentifier type in Sybase
The Sybase manual and plenty of examples claim I can write: create table run_log

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.