create account

[STEEMSQL] A public SQL database with all blockchain data – UPDATE 1 by arcange

View this thread on: hive.blogpeakd.comecency.com
· @arcange ·
$877.21
[STEEMSQL] A public SQL database with all blockchain data – UPDATE 1
https://i.imgsafe.org/77e5fc4a12.png

One week ago, I publicly made available a MS-SQL database with **all** the blockchain data in it .

This post is an update to the **[introduction post ]( https://steemit.com/steemit/@arcange/steemsql-com-a-public-sql-server-database-with-all-steemit-blockchain-data)**

## What’s new?

### New savings transactions support
With hardfork 14.2 finally deployed few hours ago, a new set of transaction type have been introduced.  

The Database Injector now manage the following new transactions :  
```
transfer_to_savings
transfer_from_savings
cancel_transfer_from_savings
```

These transactions are stored in the `TxTransfers` table with the `type` field set accordingly.
A new `request_id` field has been added to the table to store  this new information.
A new `amount_symbol` has been added to easily distinguish which currency has been transferred

### Accounts table added

https://i.imgsafe.org/2a5f723ce2.png


An `Accounts` table has been added and store all the information received from the `get_accounts` function.

This table is populated/updated has follow:

* Each time a transaction involving an **unknown** account is injected in the database, the corresponding account data are inserted in the database.
* Each time a transaction involving a **known** account is injected in the database, the corresponding account `dirty` field is set to `true`
* Every 10 minutes, all accounts flagged as *"dirty"*  are updated.

The procedure has been implemented to :
* avoid overloading the database server with too many account updates
* lower the Steem node load by querying accounts information less often

So be careful when your query involves the Accounts table. If the account is flagged as dirty, this means new transactions imported in the database may have impacted some fields value, but those values have not been updated yet.

### Performance improvement
Several indexes have been created to improve overall queries performances.

### Support

If you need help, have any comment or request, please use [SteemSQL channel](https://steemit.chat/channel/steemsql) channel on steemit.chat.

---
You like this post, do not forget to https://s22.postimg.org/n01rpphmp/pointing_fingers.gif **upvote** or **follow** me
πŸ‘  , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , and 149 others
πŸ‘Ž  
properties (23)
authorarcange
permlinksteemsql-a-public-sql-database-with-all-blockchain-data-update-1
categorysteemit
json_metadata{"tags":["steemit","analytics","stats","programming","sql"],"image":["https://i.imgsafe.org/77e5fc4a12.png","https://i.imgsafe.org/2a5f723ce2.png","https://s22.postimg.org/n01rpphmp/pointing_fingers.gif"],"links":["https://steemit.com/steemit/@arcange/steemsql-com-a-public-sql-server-database-with-all-steemit-blockchain-data","https://steemit.chat/channel/steemsql"]}
created2016-09-21 16:24:09
last_update2016-09-21 16:24:09
depth0
children18
last_payout2016-10-23 12:04:33
cashout_time1969-12-31 23:59:59
total_payout_value777.566 HBD
curator_payout_value99.644 HBD
pending_payout_value0.000 HBD
promoted0.000 HBD
body_length2,266
author_reputation1,146,606,926,313,931
root_title"[STEEMSQL] A public SQL database with all blockchain data – UPDATE 1"
beneficiaries[]
max_accepted_payout1,000,000.000 HBD
percent_hbd10,000
post_id1,318,161
net_rshares140,277,336,943,904
author_curate_reward""
vote details (214)
@andrew0 ·
Thank you for the great work!
properties (22)
authorandrew0
permlinkre-arcange-steemsql-a-public-sql-database-with-all-blockchain-data-update-1-20160921t162853263z
categorysteemit
json_metadata{"tags":["steemit"]}
created2016-09-21 16:28:51
last_update2016-09-21 16:28:51
depth1
children1
last_payout2016-10-23 12:04:33
cashout_time1969-12-31 23:59:59
total_payout_value0.000 HBD
curator_payout_value0.000 HBD
pending_payout_value0.000 HBD
promoted0.000 HBD
body_length29
author_reputation23,724,911,028,358
root_title"[STEEMSQL] A public SQL database with all blockchain data – UPDATE 1"
beneficiaries[]
max_accepted_payout1,000,000.000 HBD
percent_hbd10,000
post_id1,318,217
net_rshares0
@arcange ·
Thanks
properties (22)
authorarcange
permlinkre-andrew0-re-arcange-steemsql-a-public-sql-database-with-all-blockchain-data-update-1-20160921t163420185z
categorysteemit
json_metadata{"tags":["steemit"]}
created2016-09-21 16:34:21
last_update2016-09-21 16:34:21
depth2
children0
last_payout2016-10-23 12:04:33
cashout_time1969-12-31 23:59:59
total_payout_value0.000 HBD
curator_payout_value0.000 HBD
pending_payout_value0.000 HBD
promoted0.000 HBD
body_length6
author_reputation1,146,606,926,313,931
root_title"[STEEMSQL] A public SQL database with all blockchain data – UPDATE 1"
beneficiaries[]
max_accepted_payout1,000,000.000 HBD
percent_hbd10,000
post_id1,318,259
net_rshares0
@faddat ·
Do you sync at every block?  If not, Happy to help you adapt STEEMJSON to do this for you :).  I'm interested in using your DB for many things but I'd like to know how much abuse is too much abuse for the machines you have it hosted on?
πŸ‘  
properties (23)
authorfaddat
permlinkre-arcange-steemsql-a-public-sql-database-with-all-blockchain-data-update-1-20160921t203854705z
categorysteemit
json_metadata{"tags":["steemit"]}
created2016-09-21 20:38:54
last_update2016-09-21 20:38:54
depth1
children3
last_payout2016-10-23 12:04:33
cashout_time1969-12-31 23:59:59
total_payout_value0.000 HBD
curator_payout_value0.000 HBD
pending_payout_value0.000 HBD
promoted0.000 HBD
body_length236
author_reputation36,581,868,473,026
root_title"[STEEMSQL] A public SQL database with all blockchain data – UPDATE 1"
beneficiaries[]
max_accepted_payout1,000,000.000 HBD
percent_hbd10,000
post_id1,320,691
net_rshares17,621,506,996
author_curate_reward""
vote details (1)
@arcange ·
Every block and every transaction are synced every 10 seconds.
You can freely use the DB for any development you have. I made it public and it has been designed to support heavy load. Infrastructure may be even scaled up  if required. Go on ;)
properties (22)
authorarcange
permlinkre-faddat-re-arcange-steemsql-a-public-sql-database-with-all-blockchain-data-update-1-20160922t071039606z
categorysteemit
json_metadata{"tags":["steemit"]}
created2016-09-22 07:10:39
last_update2016-09-22 07:10:39
depth2
children2
last_payout2016-10-23 12:04:33
cashout_time1969-12-31 23:59:59
total_payout_value0.000 HBD
curator_payout_value0.000 HBD
pending_payout_value0.000 HBD
promoted0.000 HBD
body_length243
author_reputation1,146,606,926,313,931
root_title"[STEEMSQL] A public SQL database with all blockchain data – UPDATE 1"
beneficiaries[]
max_accepted_payout1,000,000.000 HBD
percent_hbd10,000
post_id1,324,933
net_rshares0
@faddat ·
I absolutely would, if the source code was released.  Without the source in the public domain you could (die, disappear, become disinterested, etc) and the services relying on this would *poof.*

If the source code were public, I'd use your server in a heartbeat.  till them I'll have to continue to schlep through this problem my own way :(.
properties (22)
authorfaddat
permlinkre-arcange-re-faddat-re-arcange-steemsql-a-public-sql-database-with-all-blockchain-data-update-1-20160924t203635524z
categorysteemit
json_metadata{"tags":["steemit"]}
created2016-09-24 20:36:36
last_update2016-09-24 20:36:36
depth3
children1
last_payout2016-10-23 12:04:33
cashout_time1969-12-31 23:59:59
total_payout_value0.000 HBD
curator_payout_value0.000 HBD
pending_payout_value0.000 HBD
promoted0.000 HBD
body_length342
author_reputation36,581,868,473,026
root_title"[STEEMSQL] A public SQL database with all blockchain data – UPDATE 1"
beneficiaries[]
max_accepted_payout1,000,000.000 HBD
percent_hbd10,000
post_id1,349,904
net_rshares0
@gamgam ·
Upvoted and following you.
properties (22)
authorgamgam
permlinkre-arcange-steemsql-a-public-sql-database-with-all-blockchain-data-update-1-20160921t162858222z
categorysteemit
json_metadata{"tags":["steemit"]}
created2016-09-21 16:29:00
last_update2016-09-21 16:29:00
depth1
children1
last_payout2016-10-23 12:04:33
cashout_time1969-12-31 23:59:59
total_payout_value0.000 HBD
curator_payout_value0.000 HBD
pending_payout_value0.000 HBD
promoted0.000 HBD
body_length26
author_reputation2,443,141,300,609
root_title"[STEEMSQL] A public SQL database with all blockchain data – UPDATE 1"
beneficiaries[]
max_accepted_payout1,000,000.000 HBD
percent_hbd10,000
post_id1,318,218
net_rshares0
@arcange ·
Thanks
properties (22)
authorarcange
permlinkre-gamgam-re-arcange-steemsql-a-public-sql-database-with-all-blockchain-data-update-1-20160921t163445670z
categorysteemit
json_metadata{"tags":["steemit"]}
created2016-09-21 16:34:45
last_update2016-09-21 16:34:45
depth2
children0
last_payout2016-10-23 12:04:33
cashout_time1969-12-31 23:59:59
total_payout_value0.000 HBD
curator_payout_value0.000 HBD
pending_payout_value0.000 HBD
promoted0.000 HBD
body_length6
author_reputation1,146,606,926,313,931
root_title"[STEEMSQL] A public SQL database with all blockchain data – UPDATE 1"
beneficiaries[]
max_accepted_payout1,000,000.000 HBD
percent_hbd10,000
post_id1,318,263
net_rshares0
@lukestokes ·
I may have to install a VM to figure out how to connect to this db via PHP, but I really am interested in figuring it out eventually. Thanks again for this hard work!
properties (22)
authorlukestokes
permlinkre-arcange-steemsql-a-public-sql-database-with-all-blockchain-data-update-1-20160921t171529861z
categorysteemit
json_metadata{"tags":["steemit"]}
created2016-09-21 17:15:30
last_update2016-09-21 17:15:30
depth1
children5
last_payout2016-10-23 12:04:33
cashout_time1969-12-31 23:59:59
total_payout_value0.000 HBD
curator_payout_value0.000 HBD
pending_payout_value0.000 HBD
promoted0.000 HBD
body_length166
author_reputation554,601,966,217,919
root_title"[STEEMSQL] A public SQL database with all blockchain data – UPDATE 1"
beneficiaries[]
max_accepted_payout1,000,000.000 HBD
percent_hbd10,000
post_id1,318,733
net_rshares0
@arcange ·
Thanks for your comment.
It's quite easy to connect using PHP :
```PHP

<?php
$serverName = "sql.steemsql.com";
$connectionInfo = array( "Database"=>"DBSteem", "UID"=>"steemit", "PWD"=>"steemit");
$conn = sqlsrv_connect( $serverName, $connectionInfo);

if( $conn ) {
     echo "Connection established.<br />";
}else{
     echo "Connection could not be established.<br />";
     die( print_r( sqlsrv_errors(), true));
}
?>

```
πŸ‘  
properties (23)
authorarcange
permlinkre-lukestokes-re-arcange-steemsql-a-public-sql-database-with-all-blockchain-data-update-1-20160921t172744010z
categorysteemit
json_metadata{"tags":["steemit"]}
created2016-09-21 17:27:42
last_update2016-09-21 17:27:42
depth2
children2
last_payout2016-10-23 12:04:33
cashout_time1969-12-31 23:59:59
total_payout_value0.000 HBD
curator_payout_value0.000 HBD
pending_payout_value0.000 HBD
promoted0.000 HBD
body_length426
author_reputation1,146,606,926,313,931
root_title"[STEEMSQL] A public SQL database with all blockchain data – UPDATE 1"
beneficiaries[]
max_accepted_payout1,000,000.000 HBD
percent_hbd10,000
post_id1,318,859
net_rshares41,179,603,672
author_curate_reward""
vote details (1)
@lukestokes ·
By default, on my mac, PHP doesn't come compiled with the drivers needed so you end up with this:

> Fatal error: Call to undefined function sqlsrv_connect() 

I spent a long time this past weekend at the RESTfest hackathon trying to get the PDO stuff to work on my mac. It turned into a big pain, unfortunately.

Are you running PHP on windows, already compiled with `php_sqlsrv_53_ts.dll`? If you could get this working on OSX, that would be fantastic.
properties (22)
authorlukestokes
permlinkre-arcange-re-lukestokes-re-arcange-steemsql-a-public-sql-database-with-all-blockchain-data-update-1-20160921t211857650z
categorysteemit
json_metadata{"tags":["steemit"]}
created2016-09-21 21:18:57
last_update2016-09-21 21:18:57
depth3
children1
last_payout2016-10-23 12:04:33
cashout_time1969-12-31 23:59:59
total_payout_value0.000 HBD
curator_payout_value0.000 HBD
pending_payout_value0.000 HBD
promoted0.000 HBD
body_length454
author_reputation554,601,966,217,919
root_title"[STEEMSQL] A public SQL database with all blockchain data – UPDATE 1"
beneficiaries[]
max_accepted_payout1,000,000.000 HBD
percent_hbd10,000
post_id1,321,048
net_rshares0
@miko · (edited)
You can get Uniserver, it's a nice lightweight server with httpd & sql, Apache 2.0(which supports PHP, javascript and the likes) and MySql respectively. Which works on Windows. Nice security, but i wouldn't use it for a production website, i only use it for development and having my own intranet(for having a family website so we can write each other, post news, chores, appointments, etc.. that's just on our own network) . I don't work for Uniserver, i just like their product. I just read you have a mac, so um ya, windows isn't mac, but i'll keep the post up incase anyone else may find it useful.
πŸ‘  
properties (23)
authormiko
permlinkre-lukestokes-re-arcange-steemsql-a-public-sql-database-with-all-blockchain-data-update-1-20160923t050402559z
categorysteemit
json_metadata{"tags":["steemit"]}
created2016-09-23 05:04:03
last_update2016-09-23 05:05:30
depth2
children1
last_payout2016-10-23 12:04:33
cashout_time1969-12-31 23:59:59
total_payout_value0.000 HBD
curator_payout_value0.000 HBD
pending_payout_value0.000 HBD
promoted0.000 HBD
body_length602
author_reputation0
root_title"[STEEMSQL] A public SQL database with all blockchain data – UPDATE 1"
beneficiaries[]
max_accepted_payout1,000,000.000 HBD
percent_hbd10,000
post_id1,334,810
net_rshares0
author_curate_reward""
vote details (1)
@arcange ·
There are several Mac alternative to SQL Server Management Studio:

[DbVisualizer](http://www.dbvis.com)
[RazorSQL](http://www.razorsql.com/)
[SQLPro for MSSQL](https://www.macsqlclient.com/)
πŸ‘  ,
properties (23)
authorarcange
permlinkre-miko-re-lukestokes-re-arcange-steemsql-a-public-sql-database-with-all-blockchain-data-update-1-20160923t092818919z
categorysteemit
json_metadata{"tags":["steemit"],"links":["http://www.dbvis.com","http://www.razorsql.com/","https://www.macsqlclient.com/"]}
created2016-09-23 09:28:18
last_update2016-09-23 09:28:18
depth3
children0
last_payout2016-10-23 12:04:33
cashout_time1969-12-31 23:59:59
total_payout_value0.000 HBD
curator_payout_value0.000 HBD
pending_payout_value0.000 HBD
promoted0.000 HBD
body_length191
author_reputation1,146,606,926,313,931
root_title"[STEEMSQL] A public SQL database with all blockchain data – UPDATE 1"
beneficiaries[]
max_accepted_payout1,000,000.000 HBD
percent_hbd10,000
post_id1,336,063
net_rshares150,204,593,946
author_curate_reward""
vote details (2)
@soldier ·
Great update! Thx
properties (22)
authorsoldier
permlinkre-arcange-steemsql-a-public-sql-database-with-all-blockchain-data-update-1-20160923t084714661z
categorysteemit
json_metadata{"tags":["steemit"]}
created2016-09-23 08:47:15
last_update2016-09-23 08:47:15
depth1
children1
last_payout2016-10-23 12:04:33
cashout_time1969-12-31 23:59:59
total_payout_value0.000 HBD
curator_payout_value0.000 HBD
pending_payout_value0.000 HBD
promoted0.000 HBD
body_length17
author_reputation132,052,333,504,410
root_title"[STEEMSQL] A public SQL database with all blockchain data – UPDATE 1"
beneficiaries[]
max_accepted_payout1,000,000.000 HBD
percent_hbd10,000
post_id1,335,895
net_rshares0
@arcange ·
More to come ... stay tuned!
properties (22)
authorarcange
permlinkre-soldier-re-arcange-steemsql-a-public-sql-database-with-all-blockchain-data-update-1-20160923t113436450z
categorysteemit
json_metadata{"tags":["steemit"]}
created2016-09-23 11:34:36
last_update2016-09-23 11:34:36
depth2
children0
last_payout2016-10-23 12:04:33
cashout_time1969-12-31 23:59:59
total_payout_value0.000 HBD
curator_payout_value0.000 HBD
pending_payout_value0.000 HBD
promoted0.000 HBD
body_length28
author_reputation1,146,606,926,313,931
root_title"[STEEMSQL] A public SQL database with all blockchain data – UPDATE 1"
beneficiaries[]
max_accepted_payout1,000,000.000 HBD
percent_hbd10,000
post_id1,336,772
net_rshares0
@steempowerwhale ·
Thanks for update. I have upvoted and resteemed.
properties (22)
authorsteempowerwhale
permlinkre-arcange-steemsql-a-public-sql-database-with-all-blockchain-data-update-1-20160921t170534309z
categorysteemit
json_metadata{"tags":["steemit"]}
created2016-09-21 17:05:33
last_update2016-09-21 17:05:33
depth1
children1
last_payout2016-10-23 12:04:33
cashout_time1969-12-31 23:59:59
total_payout_value0.000 HBD
curator_payout_value0.000 HBD
pending_payout_value0.000 HBD
promoted0.000 HBD
body_length48
author_reputation6,727,613,422,973
root_title"[STEEMSQL] A public SQL database with all blockchain data – UPDATE 1"
beneficiaries[]
max_accepted_payout1,000,000.000 HBD
percent_hbd10,000
post_id1,318,625
net_rshares0
@arcange ·
Awesome! Thanks
properties (22)
authorarcange
permlinkre-steempowerwhale-re-arcange-steemsql-a-public-sql-database-with-all-blockchain-data-update-1-20160921t172933582z
categorysteemit
json_metadata{"tags":["steemit"]}
created2016-09-21 17:29:33
last_update2016-09-21 17:29:33
depth2
children0
last_payout2016-10-23 12:04:33
cashout_time1969-12-31 23:59:59
total_payout_value0.000 HBD
curator_payout_value0.000 HBD
pending_payout_value0.000 HBD
promoted0.000 HBD
body_length15
author_reputation1,146,606,926,313,931
root_title"[STEEMSQL] A public SQL database with all blockchain data – UPDATE 1"
beneficiaries[]
max_accepted_payout1,000,000.000 HBD
percent_hbd10,000
post_id1,318,871
net_rshares0