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

  • SEARCH
  • Home
  • 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 5939311
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 22, 20262026-05-22T15:48:36+00:00 2026-05-22T15:48:36+00:00

I bought Kibot’s stock data and it is enormous. I have about 125,000,000 rows

  • 0

I bought Kibot’s stock data and it is enormous. I have about 125,000,000 rows to load (1000 stocks * 125k rows/stock [1-minute bar data since 2010-01-01], each stock in a CSV file whose fields are Date,Time,Open,High,Low,Close,Volume). I’m totally new to python (I chose it because it’s free and well-supported by a community) and I chose SQLite to store the data because of python’s built-in support for it. (And I know the SQL language very well. SQLiteStudio is a gem of a free program.)

My loader program is working well, but is getting slower. The SQLite db is about 6 Gb and it’s only halfway loaded. I’m getting about 500k rows/hour loaded using INSERT statements and committing the transaction after each stock (approx 125k rows).

So here’s the question: is PyTables substantially faster than SQLite, making the effort to learn how to use it worth it? (And since I’m in learning mode, feel free to suggest alternatives to these two.) One things that bother me about PyTables is that it’s really bare bones, almost like saving a binary file, for the free version. No “where clause” functions or indexing, so you wind up scanning for the rows you need.

After I get the data loaded, I’m going to be doing statistical analysis (rolling regression & correlation, etc) using something based on NumPy: Timeseries, larry, pandas, or a scikit. I haven’t chosen the analysis package yet, so if you have a recommendation, and that recommendation is best used with either PyTables or pandas (or whatever), please factor that in to your response.

(For @John)
Python 2.6;
Windows XP SP3 32-bit;
Manufactured strings used as INSERT statements;
Memory usage is rock solid at 750M of the 2G physical memory;
CPU usage is 10% +/- 5%;
Totally i/o bound (disk is always crunching).
DB schema:

create table MinuteBarPrices (
    SopDate smalldatetime not null,
    Ticker  char( 5 )     not null,
    Open    real,
    High    real,
    Low     real,
    Close   real          not null,
    Volume  int,
    primary key ( SopDate, Ticker )
);
create unique index MinuteBarPrices_IE1 on MinuteBarPrices (
    Ticker,
    SopDate
);
  • 1 1 Answer
  • 1 View
  • 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-22T15:48:37+00:00Added an answer on May 22, 2026 at 3:48 pm

    Suggestions:

    1. You have 1 GB of memory that’s not being used. Try using the cache_size pragma — docs here. Other pragmas of interest: synchronous and page_size … maybe too late for the latter.

    2. Sometimes it is faster to load the base table without any index(es), then create the index(es).

    3. “Manufactured strings used as INSERT statements” or any other SQL statements is a bad idea, both speed wise and security wise (google(“SQL injection attack”)). Get out of the habit now. Use parameterised SQL statements.

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

Sidebar

Related Questions

i have just bought 12 bluetooth dongles and they all have the same mac
I've just bought an ArduIMU and I'm trying to send data to Arduino. I
I have just bought FlashFirebug Pro, so I am able to run ActionScript at
I have bought a Joomla template from Template monster. It looks like this template
I recently bought Programming Scala , and have been reading through it. The language
I bought a SSL certificate for the domain https://www.mypage.com . I have other domains
I just bought a new, sub-US$1,000 laptop, one aimed squarely at the consumer, non-developer
I bought a book about MVC 3. In this book, there is an example
I have bought an IDN domain name with non-latin characters. It is good but
I bought a domain name with GoDaddy.com. I have a Ubuntu linux server running

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.