On 20 Nov 2017, at 10:54pm, Ali Dorri <alidorri...@gmail.com> wrote:

> I am doing a research on the energy consumed by a query in SQLite. I have a
> program which fills a database with blocks of data. Then, it attempts to
> remove some data from the database. I don't know how to measure the energy
> consumed from my host, i.e., my laptop which has both the SQLite and the
> program, from the time I generated the query till the query is finished and
> control returns back to my program.

This is a hardware question, not anything to do with a particular piece of 
software.

If you have a desktop computer, get one of those gadgets that you plug into the 
power socket and monitors how much power is passed to things that plug into 
them:

<https://www.amazon.co.uk/Plug-In-Power-and-Energy-Monitor/dp/B000Q7PJGW>

On a laptop, since the power is taken from an internal battery, and mains power 
is used to recharge it inconsistently, monitoring power usage from the mains is 
pointless.  See if the firmware provides a display or an API function which 
shows how much is going out.

Then set up side-by-side comparisons, one with your computer doing those things 
in SQLite and one without.  The differences between the two power consumptions 
is how much power SQLite is using.  Unless you have really detailed power 
measurement, the results will be small and probably meaningless.

Since you mention doing side-by-side comparisons with other databases, your 
setup should probably be comparing the same computer doing things in different 
DBMSs.  Maybe set up some procedure for doing something 10,000 times and see 
how much power is used in total.

Worth noting that power consumption from SQLite will be terribly inconsistent, 
based on what data is cached, how many database pages need to be accessed, and 
the state of the journal files.  This pales into insignificance, however, with 
the inconsistency of most other DBMSs, which perform far more internal caching 
and indexing.  You will get very different results from the same setup 
depending on how long the DBMS server has been running, not just on how long 
the computer has been turned on.

Simon.
_______________________________________________
sqlite-users mailing list
sqlite-users@mailinglists.sqlite.org
http://mailinglists.sqlite.org/cgi-bin/mailman/listinfo/sqlite-users

Reply via email to