{"id":273785,"date":"2016-02-08T10:03:04","date_gmt":"2016-02-08T07:03:04","guid":{"rendered":"http:\/\/savepearlharbor.com\/?p=273785"},"modified":"-0001-11-30T00:00:00","modified_gmt":"-0001-11-29T21:00:00","slug":"","status":"publish","type":"post","link":"https:\/\/savepearlharbor.com\/?p=273785","title":{"rendered":"\u041f\u0440\u043e\u0444\u0438\u043b\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u0435 \u0437\u0430\u043f\u0440\u043e\u0441\u043e\u0432 \u043a SQLite \u0434\u043b\u044f Qt \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0439"},"content":{"rendered":"<p>       \u0418\u043c\u0435\u0435\u0442\u0441\u044f \u0442\u0438\u043f\u0438\u0447\u043d\u0430 \u0441\u0438\u0442\u0443\u0430\u0446\u0438\u044f:<\/p>\n<ul>\n<li>\u043a\u0435\u043c-\u0442\u043e \u043d\u0430\u043f\u0438\u0441\u0430\u043d\u043d\u043e\u0435 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0435 \u043d\u0430 Qt;<\/li>\n<li>\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u0438 \u0436\u0430\u043b\u0443\u044e\u0442\u0441\u044f, \u0447\u0442\u043e \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u0430 \u0432\u043e \u0432\u0440\u0435\u043c\u044f \u0440\u0430\u0431\u043e\u0442\u044b \u0436\u0440\u0435\u043c \u043c\u043d\u043e\u0433\u043e CPU;<\/li>\n<li>\u043f\u0440\u043e\u0444\u0438\u043b\u0438\u0440\u043e\u0432\u0449\u0438\u043a \u0438 strace \u0443\u043a\u0430\u0437\u044b\u0432\u0430\u044e\u0442 \u043d\u0430 \u0442\u043e, \u0447\u0442\u043e \u043f\u0440\u043e\u0438\u0441\u0445\u043e\u0434\u0438\u0442 \u043d\u0430\u0441\u0438\u043b\u043e\u0432\u0430\u043d\u0438\u0435 \u0431\u0430\u0437\u044b.<\/li>\n<\/ul>\n<p>  \u0412 \u0442\u0430\u043a\u043e\u0439 \u0441\u0438\u0442\u0443\u0430\u0446\u0438\u0438 \u0445\u043e\u0447\u0435\u0442\u0441\u044f \u043f\u043e\u0441\u043c\u043e\u0442\u0440\u0435\u0442\u044c \u0447\u0442\u043e \u0437\u0430 \u0437\u0430\u043f\u0440\u043e\u0441\u044b, \u0438\u0445 \u043a\u043e\u043b\u0438\u0447\u0435\u0441\u0442\u0432\u043e, \u0432\u0440\u0435\u043c\u044f \u0432\u044b\u043f\u043e\u043b\u043d\u0435\u043d\u0438\u044f. \u0415\u0441\u043b\u0438 \u0432 PostgreSQL \u0435\u0441\u0442\u044c <a href=\"http:\/\/www.postgresql.org\/docs\/9.5\/static\/pgstatstatements.html\">pg_stat_statements<\/a> \u0438 <a href=\"http:\/\/dalibo.github.io\/pgbadger\/\">pgBadger<\/a>, \u0442\u043e \u0434\u043b\u044f SQLite \u043f\u0440\u0438\u0448\u043b\u043e\u0441\u044c \u043d\u0430\u043f\u0438\u0441\u0430\u0442\u044c \u0441\u0432\u043e\u0439 \u0441\u0430\u043c\u043e\u043a\u0430\u0442. \u0421\u0430\u043c\u043e\u043a\u0430\u0442 \u043f\u0440\u0435\u0434\u0441\u0442\u0430\u0432\u043b\u044f\u0435\u0442 \u0438\u0437 \u0441\u0435\u0431\u044f \u0432\u044b\u0437\u043e\u0432 <a href=\"https:\/\/www.sqlite.org\/c3ref\/profile.html\">sqlite3_profile<\/a> \u0434\u043b\u044f \u043a\u0430\u0436\u0434\u043e\u0433\u043e \u0441\u043e\u0435\u0434\u0438\u043d\u0435\u043d\u0438\u044f, \u0437\u0430\u043f\u0438\u0441\u044c \u043f\u043e\u043b\u0443\u0447\u0435\u043d\u043d\u043e\u0439 \u0438\u043d\u0444\u043e\u0440\u043c\u0430\u0446\u0438\u0438 \u0432 \u0436\u0443\u0440\u043d\u0430\u043b. <\/p>\n<p>  <a name=\"habracut\"><\/a>  <\/p>\n<h2>\u0423\u0441\u0442\u0430\u043d\u043e\u0432\u043a\u0430 \u043e\u0431\u0440\u0430\u0431\u043e\u0442\u0447\u0438\u043a\u0430 sqlite3_profile<\/h2>\n<p>  <a href=\"http:\/\/doc.qt.io\/qt-5\/qsqldriver.html\">QSqlDriver<\/a> \u043f\u0440\u0435\u0434\u043e\u0441\u0442\u0430\u0432\u043b\u044f\u0435\u0442 \u043d\u0430\u043c <a href=\"http:\/\/doc.qt.io\/qt-5\/qsqldriver.html#handle\">handle<\/a>, \u043e\u0442\u043a\u0443\u0434\u0430 \u043d\u0430\u043c \u043c\u043e\u0436\u043d\u043e \u0432\u044b\u0442\u0430\u0449\u0438\u0442\u044c \u043e\u0431\u0440\u0430\u0431\u043e\u0442\u0447\u0438\u043a <code>sqlite3*<\/code>. \u0412 Qt5 \u043d\u0430\u043c \u043f\u0440\u0438\u0434\u0435\u0442\u0441\u044f \u0432\u044b\u043f\u043e\u043b\u043d\u0438\u0442\u044c \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0435\u0435<\/p>\n<pre><code class=\"cpp\">Q_DECLARE_OPAQUE_POINTER(sqlite3*); Q_DECLARE_METATYPE(sqlite3*);  \/\/.... QVariant v = driver-&gt;handle(); const QString tpName = v.typeName();  if (v.isValid() &amp;&amp; (tpName == &quot;sqlite3*&quot;)) {     sqlite3* handle = v.value&lt;sqlite3*&gt;();     if (handle != nullptr)     {         sqlite3_profile(handle, profile, this);     } }<\/code><\/pre>\n<p>  \u041c\u0430\u043a\u0440\u043e\u0441\u044b <code>Q_DECLARE_*<\/code> \u0434\u043b\u044f \u0440\u0435\u0433\u0438\u0441\u0442\u0440\u0430\u0446\u0438\u0438 \u0442\u0438\u043f\u0430 <code>sqlite3*<\/code>, \u0447\u0442\u043e \u0431\u044b \u043f\u043e\u0442\u043e\u043c \u0432\u044b\u0442\u0430\u0449\u0438\u0442\u044c \u0438\u0437 <a href=\"http:\/\/doc.qt.io\/qt-5\/qvariant.html\">QVariant<\/a>.<\/p>\n<h2>\u041e\u0431\u0440\u0430\u0431\u043e\u0442\u0447\u0438\u043a<\/h2>\n<p>  \u0421\u0438\u0433\u043d\u0430\u0442\u0443\u0440\u0430 \u043e\u0431\u0440\u0430\u0431\u043e\u0442\u0447\u0438\u043a\u0430 \u0438\u043c\u0435\u0435\u0442 \u0432\u0438\u0434<\/p>\n<pre><code class=\"cpp\">void profile(void* userData, const char* sql, sqlite3_uint64 time)<\/code><\/pre>\n<p>  \u041f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u044b:<\/p>\n<ul>\n<li>userData \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044c\u0441\u043a\u0438\u0435 \u0434\u0430\u043d\u043d\u044b\u0435 \u0443\u0441\u0442\u0430\u043d\u043e\u0432\u043b\u0435\u043d\u043d\u044b\u0435 \u0432 <code>sqlite3_profile<\/code>, \u0432 \u043c\u043e\u0435\u043c \u0441\u043b\u0443\u0447\u0430\u0435 \u044d\u0442\u043e <code>this<\/code>;<\/li>\n<li>sql \u0442\u0435\u043a\u0441\u0442 \u0437\u0430\u043f\u0440\u043e\u0441\u0430 \u0432 UTF-8;<\/li>\n<li>time \u0432\u0440\u0435\u043c\u044f \u0440\u0430\u0431\u043e\u0442\u044b \u0437\u0430\u043f\u0440\u043e\u0441\u0430 \u0432 \u043d\u0430\u043d\u043e\u0441\u0435\u043a\u0443\u043d\u0434\u0430\u0445, \u043d\u043e \u0442\u0435\u043a\u0443\u0449\u0430\u044f \u0440\u0435\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u044f \u043e\u0431\u0435\u0441\u043f\u0435\u0447\u0438\u0432\u0430\u0435\u0442 \u0442\u043e\u0447\u043d\u043e\u0441\u0442\u044c \u0434\u043e \u043c\u0438\u043b\u043b\u0438\u0441\u0435\u043a\u0443\u043d\u0434.<\/li>\n<\/ul>\n<p>  \u0418\u0441\u0445\u043e\u0434\u043d\u0438\u043a\u0438 \u043a\u043b\u0430\u0441\u0441\u0430 \u043b\u043e\u0433\u0430 \u0437\u0430\u043d\u0438\u043c\u0430\u0435\u0442 &lt; 200 \u0441\u0442\u0440\u043e\u043a<\/p>\n<p>  <\/p>\n<pre><code class=\"cpp\">#pragma once  #include &lt;memory&gt;  #include &lt;QtCore\/QString&gt;  class QSqlDriver;  namespace QSqliteProfiler {  struct LogRecord {     quint64 timestamp;     quint64 duration;     QString query; };  class Log { public:      static Log&amp; instance();      void setProfile(QSqlDriver* driver);      void setLogFile(const QString&amp; file);     void write(const LogRecord&amp; record);  private:      Log();     ~Log();  private:      struct LogImpl;     std::unique_ptr&lt;LogImpl&gt; m_impl; }; }  inline QDataStream &amp; operator&lt;&lt; (QDataStream&amp; stream, const QSqliteProfiler::LogRecord record) {     stream&lt;&lt;record.timestamp&lt;&lt;record.duration&lt;&lt;record.query;  }  inline QDataStream &amp; operator&gt;&gt; (QDataStream&amp; stream, QSqliteProfiler::LogRecord&amp; record) {     stream&gt;&gt;record.timestamp&gt;&gt;record.duration&gt;&gt;record.query; }<\/code><\/pre>\n<pre><code class=\"cpp\">#include &lt;mutex&gt; #include &lt;sqlite3.h&gt;  #include &lt;QtCore\/QFile&gt; #include &lt;QtCore\/QDebug&gt; #include &lt;QtCore\/QVariant&gt; #include &lt;QtCore\/QDateTime&gt; #include &lt;QtCore\/QMetaType&gt; #include &lt;QtCore\/QDataStream&gt;  #include &lt;QtSql\/QSqlDriver&gt;  Q_DECLARE_OPAQUE_POINTER(sqlite3*); Q_DECLARE_METATYPE(sqlite3*);  #include &quot;Log.h&quot;  typedef std::lock_guard&lt;std::mutex&gt; LockGuard;  namespace {  void profile(void* userData, const char* sql, sqlite3_uint64 time) {     using namespace QSqliteProfiler;      const quint64 timestamp = QDateTime::currentMSecsSinceEpoch();     LogRecord record{timestamp, time, sql};      auto log = static_cast&lt;Log*&gt;(userData);     log-&gt;write(record); }  }  namespace QSqliteProfiler {  Log&amp; Log::instance() {     static Log log;     return log; }  struct Log::LogImpl {     ~LogImpl()     {         LockGuard lock(fileMutex);          if(file.isOpen())         {             file.flush();             file.close();         }     }      QFile file;     QDataStream stream;     std::mutex fileMutex; };  Log::Log() :         m_impl(new LogImpl) {  }  Log::~Log() = default;  void Log::setProfile(QSqlDriver* driver) {     QVariant v = driver-&gt;handle();     const QString tpName = v.typeName();      if (v.isValid() &amp;&amp; (tpName == &quot;sqlite3*&quot;))     {         sqlite3* handle = v.value&lt;sqlite3*&gt;();         if (handle != nullptr)         {             sqlite3_profile(handle, profile, this);         }     } }  void Log::setLogFile(const QString&amp; file) {     LockGuard lock(m_impl-&gt;fileMutex);      if(m_impl-&gt;file.isOpen())     {         m_impl-&gt;file.close();     }      m_impl-&gt;file.setFileName(file);     auto isOpen = m_impl-&gt;file.open(QIODevice::WriteOnly);     if(isOpen)     {         m_impl-&gt;stream.setDevice(&amp;m_impl-&gt;file);     }     else     {         qCritical()&lt;&lt;&quot;Can not open file for writing, file&quot;&lt;&lt;file;         qDebug()&lt;&lt;m_impl-&gt;file.errorString();         exit(1);     } }  void Log::write(const LogRecord&amp; record) {     LockGuard lock(m_impl-&gt;fileMutex);     if(m_impl-&gt;file.isOpen())     {         m_impl-&gt;stream&lt;&lt;record;     } } }<\/code><\/pre>\n<p>  <\/p>\n<h2>\u041f\u0440\u0438\u043c\u0435\u0440 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u044f<\/h2>\n<p>  \u0411\u0435\u0441\u0441\u043c\u044b\u0441\u043b\u0435\u043d\u043d\u044b\u0439 \u0438 \u0442\u0443\u043f\u043e\u0439 \u043f\u0440\u0438\u043c\u0435\u0440<\/p>\n<pre><code class=\"cpp\">#include &lt;QtCore\/QDebug&gt; #include &lt;QtCore\/QCoreApplication&gt;  #include &lt;QtSql\/QSqlQuery&gt; #include &lt;QtSql\/QSqlDriver&gt; #include &lt;QtSql\/QSqlDatabase&gt;  #include &quot;Log.h&quot;  int main(int argc, char *argv[]) {      using namespace QSqliteProfiler;      QCoreApplication app(argc, argv);     Log::instance().setLogFile(&quot;sqlite.profile&quot;);      QSqlDatabase db = QSqlDatabase::addDatabase(&quot;QSQLITE&quot;);     db.setDatabaseName(&quot;db.sqlite&quot;);      if (!db.open()) {            qDebug()&lt;&lt;&quot;Test data base not open&quot;;            return 1;     }      Log::instance().setProfile(db.driver());      QSqlQuery query;     query.exec( &quot;CREATE TABLE my_table (&quot;             &quot;number integer PRIMARY KEY NOT NULL, &quot;             &quot;address VARCHAR(255), &quot;             &quot;age integer&quot;             &quot;);&quot;);      QString str;     \/\/db.transaction();     for(int i = 0; i &lt; 100; ++i)     {         QSqlQuery query1(db);         query1.prepare(&quot;INSERT INTO my_table(number, address, age) VALUES (?, ?, ?)&quot;);         query1.bindValue(0, i);         query1.bindValue(1, &quot;hello world str.&quot;);         query1.bindValue(2, 37);         query1.exec();     }     \/\/db.commit();      return 0; }<\/code><\/pre>\n<p>  \u041f\u043e\u0441\u043b\u0435 \u043e\u0442\u043a\u0440\u044b\u0442\u0438\u044f \u0431\u0430\u0437\u044b, \u0443\u0441\u0442\u0430\u043d\u0430\u0432\u043b\u0438\u0432\u0430\u0435\u043c \u043e\u0431\u0440\u0430\u0431\u043e\u0442\u0447\u0438\u043a <code>Log::instance().setProfile(db.driver());<\/code><br \/>  \u041f\u0440\u0438 \u043f\u043e\u043c\u043e\u0449\u0438 \u0432\u0441\u043f\u043e\u043c\u043e\u0433\u0430\u0442\u0435\u043b\u044c\u043d\u043e\u0439 <a href=\"https:\/\/github.com\/RPG-18\/QSqliteProfiler\/blob\/master\/src\/Log2db.cpp\">\u0443\u0442\u0438\u043b\u0438\u0442\u044b<\/a> \u043f\u0440\u0435\u043e\u0431\u0440\u0430\u0437\u0443\u0435\u043c \u043b\u043e\u0433 \u0432 \u0431\u0430\u0437\u0443 \u0434\u0430\u043d\u043d\u044b\u0445 SQLite, \u0434\u043b\u044f \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u044f \u043c\u043e\u0449\u0438 SQL.<\/p>\n<p>  \u0417\u0430\u043f\u0440\u043e\u0441<\/p>\n<pre><code class=\"sql\">SELECT   count(time) AS CNT,    avg(time)\/1000000  AS AVG ,   sum(time)\/1000000 AS TIME,   query  FROM query GROUP BY query<\/code><\/pre>\n<p>  \u0412\u044b\u0434\u0430\u0441\u0442 \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442<\/p>\n<table>\n<thead>\n<tr>\n<th>CNT<\/th>\n<th>AVG<\/th>\n<th>TIME<\/th>\n<th>QUERY<\/th>\n<\/tr>\n<\/thead>\n<tbody>\n<tr>\n<td>1<\/td>\n<td>155.0<\/td>\n<td>155<\/td>\n<td>CREATE TABLE my_table (number integer PRIMARY KEY NOT NULL, address VARCHAR(255), age integer);<\/td>\n<\/tr>\n<tr>\n<td>100<\/td>\n<td>149.55<\/td>\n<td>14955<\/td>\n<td>INSERT INTO my_table(number, address, age) VALUES (?, ?, ?)<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<p>  \u041e\u0436\u0438\u0434\u0430\u0435\u043c\u044b\u0439 \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442 \u043a\u043e\u0433\u0434\u0430 \u043d\u0435 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u044e\u0442\u0441\u044f \u0442\u0440\u0430\u043d\u0437\u0430\u043a\u0446\u0438\u0438. \u0421\u0440\u0435\u0434\u043d\u0435\u0435 \u0432\u0440\u0435\u043c\u044f \u043e\u043f\u0435\u0440\u0430\u0446\u0438\u0438 \u0432\u0441\u0442\u0430\u0432\u043a\u0438 \u0437\u0430\u043d\u0438\u043c\u0430\u0435\u0442 150 \u043c\u0438\u043b\u043b\u0438\u0441\u0435\u043a\u0443\u043d\u0434, \u0432\u0440\u0435\u043c\u044f \u0432\u0441\u0442\u0430\u0432\u043a\u0438 \u0432\u0441\u0435\u0445 \u0437\u0430\u043f\u0438\u0441\u0435\u0439 15 \u0441\u0435\u043a\u0443\u043d\u0434. \u0427\u0443\u0442\u043e\u0447\u043a\u0443 \u0438\u043d\u0442\u0435\u0440\u0435\u0441\u043d\u0435\u0439 \u043f\u043e\u043b\u0443\u0447\u0430\u0435\u0442\u0441\u044f \u0435\u0441\u043b\u0438 \u0440\u0430\u0441\u043a\u043e\u043c\u043c\u0435\u043d\u0442\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u0442\u0440\u0430\u043d\u0437\u0430\u043a\u0446\u0438\u044e.<\/p>\n<table>\n<thead>\n<tr>\n<th>CNT<\/th>\n<th>AVG<\/th>\n<th>TIME<\/th>\n<th>QUERY<\/th>\n<\/tr>\n<\/thead>\n<tbody>\n<tr>\n<td>1<\/td>\n<td>0.0<\/td>\n<td>0<\/td>\n<td>BEGIN<\/td>\n<\/tr>\n<tr>\n<td>1<\/td>\n<td>129.0<\/td>\n<td>129<\/td>\n<td>COMMIT<\/td>\n<\/tr>\n<tr>\n<td>1<\/td>\n<td>132.0<\/td>\n<td>132<\/td>\n<td>CREATE TABLE my_table (number integer PRIMARY KEY NOT NULL, address VARCHAR(255), age integer);<\/td>\n<\/tr>\n<tr>\n<td>100<\/td>\n<td>0.02<\/td>\n<td>2<\/td>\n<td>INSERT INTO my_table(number, address, age) VALUES (?, ?, ?)<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<p>  \u0412\u0435\u0441\u044c \u043a\u043e\u0434 \u0434\u043e\u0441\u0442\u0443\u043f\u0435\u043d \u043d\u0430 <a href=\"https:\/\/github.com\/RPG-18\/QSqliteProfiler\">GitHub<\/a>. \u041f\u0440\u0438 \u043a\u043e\u043c\u043f\u0438\u043b\u044f\u0446\u0438\u0438 \u0441\u043b\u0435\u0434\u0438\u0442\u0435 \u0447\u0442\u043e\u0431\u044b \u0432\u0435\u0440\u0441\u0438\u044f SQLite \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u043c\u0430\u044f \u0432 Qt \u0438 \u043b\u0438\u043d\u043a\u0443\u0435\u043c\u0430\u044f(\u043d\u0443\u0436\u043d\u043e \u0434\u043b\u044f sqlite3_profile) \u043a \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044e \u0431\u044b\u043b\u0438 \u0441\u043e\u0432\u043c\u0435\u0441\u0442\u0438\u043c\u044b, \u0438\u043d\u0430\u0447\u0435 \u043c\u043e\u0436\u043d\u043e \u043f\u043e\u043b\u0443\u0447\u0438\u0442\u044c \u043f\u0430\u0434\u0435\u043d\u0438\u0435.                 <\/p>\n<div class=\"clear\"><\/div>\n<p> \u0441\u0441\u044b\u043b\u043a\u0430 \u043d\u0430 \u043e\u0440\u0438\u0433\u0438\u043d\u0430\u043b \u0441\u0442\u0430\u0442\u044c\u0438 <a href=\"https:\/\/habrahabr.ru\/post\/276711\/\"> https:\/\/habrahabr.ru\/post\/276711\/<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<p>       \u0418\u043c\u0435\u0435\u0442\u0441\u044f \u0442\u0438\u043f\u0438\u0447\u043d\u0430 \u0441\u0438\u0442\u0443\u0430\u0446\u0438\u044f:<\/p>\n<ul>\n<li>\u043a\u0435\u043c-\u0442\u043e \u043d\u0430\u043f\u0438\u0441\u0430\u043d\u043d\u043e\u0435 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0435 \u043d\u0430 Qt;<\/li>\n<li>\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u0438 \u0436\u0430\u043b\u0443\u044e\u0442\u0441\u044f, \u0447\u0442\u043e \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u0430 \u0432\u043e \u0432\u0440\u0435\u043c\u044f \u0440\u0430\u0431\u043e\u0442\u044b \u0436\u0440\u0435\u043c \u043c\u043d\u043e\u0433\u043e CPU;<\/li>\n<li>\u043f\u0440\u043e\u0444\u0438\u043b\u0438\u0440\u043e\u0432\u0449\u0438\u043a \u0438 strace \u0443\u043a\u0430\u0437\u044b\u0432\u0430\u044e\u0442 \u043d\u0430 \u0442\u043e, \u0447\u0442\u043e \u043f\u0440\u043e\u0438\u0441\u0445\u043e\u0434\u0438\u0442 \u043d\u0430\u0441\u0438\u043b\u043e\u0432\u0430\u043d\u0438\u0435 \u0431\u0430\u0437\u044b.<\/li>\n<\/ul>\n<p>  \u0412 \u0442\u0430\u043a\u043e\u0439 \u0441\u0438\u0442\u0443\u0430\u0446\u0438\u0438 \u0445\u043e\u0447\u0435\u0442\u0441\u044f \u043f\u043e\u0441\u043c\u043e\u0442\u0440\u0435\u0442\u044c \u0447\u0442\u043e \u0437\u0430 \u0437\u0430\u043f\u0440\u043e\u0441\u044b, \u0438\u0445 \u043a\u043e\u043b\u0438\u0447\u0435\u0441\u0442\u0432\u043e, \u0432\u0440\u0435\u043c\u044f \u0432\u044b\u043f\u043e\u043b\u043d\u0435\u043d\u0438\u044f. \u0415\u0441\u043b\u0438 \u0432 PostgreSQL \u0435\u0441\u0442\u044c <a href=\"http:\/\/www.postgresql.org\/docs\/9.5\/static\/pgstatstatements.html\">pg_stat_statements<\/a> \u0438 <a href=\"http:\/\/dalibo.github.io\/pgbadger\/\">pgBadger<\/a>, \u0442\u043e \u0434\u043b\u044f SQLite \u043f\u0440\u0438\u0448\u043b\u043e\u0441\u044c \u043d\u0430\u043f\u0438\u0441\u0430\u0442\u044c \u0441\u0432\u043e\u0439 \u0441\u0430\u043c\u043e\u043a\u0430\u0442. \u0421\u0430\u043c\u043e\u043a\u0430\u0442 \u043f\u0440\u0435\u0434\u0441\u0442\u0430\u0432\u043b\u044f\u0435\u0442 \u0438\u0437 \u0441\u0435\u0431\u044f \u0432\u044b\u0437\u043e\u0432 <a href=\"https:\/\/www.sqlite.org\/c3ref\/profile.html\">sqlite3_profile<\/a> \u0434\u043b\u044f \u043a\u0430\u0436\u0434\u043e\u0433\u043e \u0441\u043e\u0435\u0434\u0438\u043d\u0435\u043d\u0438\u044f, \u0437\u0430\u043f\u0438\u0441\u044c \u043f\u043e\u043b\u0443\u0447\u0435\u043d\u043d\u043e\u0439 \u0438\u043d\u0444\u043e\u0440\u043c\u0430\u0446\u0438\u0438 \u0432 \u0436\u0443\u0440\u043d\u0430\u043b. <\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[],"tags":[],"class_list":["post-273785","post","type-post","status-publish","format-standard","hentry"],"_links":{"self":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/273785","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=273785"}],"version-history":[{"count":0,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/273785\/revisions"}],"wp:attachment":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=273785"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=273785"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=273785"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}