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 7069857
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 28, 20262026-05-28T05:29:48+00:00 2026-05-28T05:29:48+00:00

I am having a problem regarding a Log Searching Speed and Disk Size. It

  • 0

I am having a problem regarding a Log Searching Speed and Disk Size.
It is extremely big, it has about 220 millions rows and 25 gigabyte disk size and takes several minutes to fetch some selects.

How does it work?
The log is saved in the database using Sql Anywhere, currently version 9 and soon will be migrated to 11 (we tried to 12, but due some driver and some problems, we went back to 11).

The log consists with two tables (name changed to english so the people here are able to understand):

LogTable

Id, DateTime, User, Url, Action and TableName.
Action is what the used did: insert/delete/update
TableName is which table in the database was affected.

LogTableFields

Id, LogTable_Id, FieldName, NewValue, OldValue.
LogTable_Id is foreign key from LogTable.
FieldName is the field of the table from DB.

Important to note that NewValue and OldValue are type of varchar. Because it’s recorded every kind of fields from other tables (datetime, int, etc).

Why it was made this way?
Because we must record everything important. The system is made to an Institutional Department of Traffic (i don’t know if it’s spelled this way in proper english, but now you can an ideia what this is about) and sometimes they demand some kind of random report.

Until now, we have made our report simply doing some SQL select. However it takes several minutes to complete, even if datetime filtered. Isn’t and issue to complain when it’s not request often.

But they are demanding more and more reports that it is necessary to create a feature in the software with a nice and beauty report. As we never know theirs needs, we must go back to log and unbury the data.

Some information requested are only in the log. (e.g what user gave improperly access of the vehicle to someone)

Some ideas suggested until now:

Idea 1:
I did some researches and I was told to work with NoSql using CouchDB. But the little i read i feel NoSql isn’t a solution for my problem. I can’t argue why for non experience in it.

Idea 2:
Separate the Log Tables physically from the Database or from the machine.

Idea 3: Create a mirror from every table with a version field to keep history.

I’d like a macro optimization or architecture change if needed.

  • 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-28T05:29:49+00:00Added an answer on May 28, 2026 at 5:29 am

    This seems like a pretty standard audit table. I’m not sure you need to go to a NoSQL solution for this. 220mil rows will be comfortably handled by most RDBMs.

    It seems that the biggest problem is the table structure. Generally you flatten the table to improve logging speed and normalize it to improve reporting speed. As you can see these are conflicting.

    If you were using something like MS SQL, you could build a single flat table for logging performance, then build a simple Analysis Services cube on top of it.

    Another option would be to just optimize for reporting assuming you could maintain sufficient logging throughput. To do that, you may want to create a structure like this:

    create table LogTable (
      LogTableID int identity(1,1),
      TableName varchar(100),
      Url varchar(200)
    )
    
    create table LogUser (
      LogUserID int indentity(1,1),
      UserName varchar(100)
    )
    
    create table LogField (
      LogFieldID int identity(1,1),
      FieldName varchar(100),
    )
    
    create table LogData (
      LogDataID bigint identity(1,1),
      LogDate datetime,
      LogTableID int references LogTable(LogTableID),
      LogFieldID int references LogField(LogFieldID),
      LogUserID int references LogUserID(LogUserID),
      Action char(1), -- U = update, I = insert, D = delete
      OldValue varchar(100),
      NewValue varchar(100)
    )
    

    This should still be fast enough to log data quickly, but provide enough performance for reporting. Index design is also important, generally done in order of increasing cardinality, so something like LogData(LogTableID, LingFieldID, LogDate). You can also get fancy with partitioning to allow for parallelized queries.

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

Sidebar

Related Questions

Additional questions regarding SilentGhost's initial answer to a problem I'm having parsing Twitter RSS
Im having a problem regarding installing ADT plugin on Eclipse. the error prompt was
I am having a problem regarding a jquery dropdownmenu. I have put a slidedown
Having a strange problem regarding the postback of a form I've created. The answer
i am facing a problem regarding the thread. I am having a class which
I'm having problem regarding session items. Before I use them, I want to check
I'm having problem regarding max and sqrt If I include math.h it coudn't find
im having a problem regarding using background property with url('location') value with a div
I'm having a problem regarding Unicode in Python. I can print the output fine
I am facing a problem regarding putting my custom log file into the android

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.