SlideShare a Scribd company logo
1 of 21
Download to read offline


/* lib/Giga/Core/Repository/SeriesComment.pm at line 200 */ SELECT COUNT(*)
FROM `series_comment`
WHERE (`is_public` = '1') AND (`series_id` = ‘10834108156628842496');

+----+-------------+-||-+-------+------------------------------------+
| id | select_type | || | rows | Extra |
+----+-------------+-||-+-------+------------------------------------+
| 1 | SIMPLE | || | 30872 | Using index condition; Using where |
+----+-------------+-||-+-------+------------------------------------+
1 row in set (0.05 sec)
/* lib/Giga/Core/Repository/SeriesComment.pm at line 200 */ SELECT COUNT(*)
FROM `series_comment`
WHERE (`series_id` = ‘10834108156628842496') AND (`is_public` = '1')G


/* lib/Giga/Core/Repository/SeriesComment.pm at line 200 */ SELECT COUNT(*)
FROM `series_comment`
WHERE (`is_public` = '1') AND (`series_id` = '10834108156628842496')G
sub get_public_comments_count {
args my $class => 'ClassName',
my $series => 'Giga::Core::Model::Series',
;
my $core_db = Giga::DB->new->core;
return $core_db->count(
'series_comment',
'*',
+{
series_id => $series->id,
is_public => 1,
},
);
}
my $w = $self->new_condition;
my @w = ref $where eq 'ARRAY' ? @$where : %$where;
while (my ($col, $val) = splice @w, 0, 2) {
$w->add($col => $val);
}
return $core_db->count(
'series_comment',
'*',
- +{
+ [
series_id => $series->id,
is_public => 1,
- },
+ ],
);
return $core_db->count(
'series_comment',
'*',
- +{
+ [
series_id => $series->id,
is_public => 1,
- },
+ ],
);
#!/usr/bin/env perl
# This program is part of Percona Toolkit: http://www.percona.com/soft
# See "COPYRIGHT, LICENSE, AND WARRANTY" at the end of this file for l
# notices and disclaimers.
use strict;
use warnings FATAL => 'all';
# This tool is "fat-packed": most of its dependent modules are embedde
$ wc pt-query-digest
16920 64009 527581 pt-query-digest
# This tool is "fat-packed": most of its dependent modules are embedded
# in this file. Setting %INC to this file for each module makes Perl aware
# of this so it will not try to load the module from @INC. See the tool's
# documentation for a full list of dependencies.
$query =~ s/["']//g; # quoted strings
$query =~ s/".*?"/?/sg; # quoted strings
$query =~ s/'.*?'/?/sg; # quoted strings
$query =~ s/bfalseb|btrueb/?/isg; # boolean values
...
$query =~ s/As+//; # Chop off leading whitespace
chomp $query; # Kill trailing whitespace
$query =~ tr[ ntrf][ ]s; # Collapse whitespace
$query = lc $query;
$query =~ s/bnullb/?/g; # Get rid of NULLs
$query =~ s{ # Collapse IN and VALUES lists
b(in|values?)(?:[s,]*([s?,]*))+
}
{$1(?+)}gx;


sub select_query {
my ($self, $table, $fields, $where, $opt) = @_;
if (ref($where) eq 'HASH') {
$where = [map { ($_, $where->{$_}) } (sort keys %$where)];
}
$self->SUPER::select_query($table, $fields, $where, $opt);
}
/* lib/Giga/Core/Repository/SeriesComment.pm at line 200 */ SELECT COUNT(*)
FROM `series_comment`
WHERE (`is_public` = '1') AND (`series_id` = '10834108156628842496')G





More Related Content

What's hot

Functional perl
Functional perlFunctional perl
Functional perlErrorific
 
Swift에서 꼬리재귀 사용기 (Tail Recursion)
Swift에서 꼬리재귀 사용기 (Tail Recursion)Swift에서 꼬리재귀 사용기 (Tail Recursion)
Swift에서 꼬리재귀 사용기 (Tail Recursion)진성 오
 
News of the Symfony2 World
News of the Symfony2 WorldNews of the Symfony2 World
News of the Symfony2 WorldFabien Potencier
 
The Perl6 Type System
The Perl6 Type SystemThe Perl6 Type System
The Perl6 Type Systemabrummett
 
Building Your First Widget
Building Your First WidgetBuilding Your First Widget
Building Your First WidgetChris Wilcoxson
 
Looping the Loop with SPL Iterators
Looping the Loop with SPL IteratorsLooping the Loop with SPL Iterators
Looping the Loop with SPL IteratorsMark Baker
 
Creating a compiler in Perl 6
Creating a compiler in Perl 6Creating a compiler in Perl 6
Creating a compiler in Perl 6Andrew Shitov
 
QNlocal: Docker, Continuous Integration, WordPress e milioni di visite. Si è ...
QNlocal: Docker, Continuous Integration, WordPress e milioni di visite. Si è ...QNlocal: Docker, Continuous Integration, WordPress e milioni di visite. Si è ...
QNlocal: Docker, Continuous Integration, WordPress e milioni di visite. Si è ...alessandro mazzoli
 
Build a compiler in 2hrs - NCrafts Paris 2015
Build a compiler in 2hrs -  NCrafts Paris 2015Build a compiler in 2hrs -  NCrafts Paris 2015
Build a compiler in 2hrs - NCrafts Paris 2015Phillip Trelford
 
The hidden and new parts of JS
The hidden and new parts of JSThe hidden and new parts of JS
The hidden and new parts of JSRitesh Kumar
 
Get into the FLOW with Extbase
Get into the FLOW with ExtbaseGet into the FLOW with Extbase
Get into the FLOW with ExtbaseJochen Rau
 
Unlocking Museum Systems with Open Source
Unlocking Museum Systems with Open SourceUnlocking Museum Systems with Open Source
Unlocking Museum Systems with Open SourceRichard Barrett-Small
 
Groovy every day
Groovy every dayGroovy every day
Groovy every dayPaul Woods
 
ABAP EVENTS EXAMPLE
ABAP EVENTS EXAMPLEABAP EVENTS EXAMPLE
ABAP EVENTS EXAMPLEvr1sap
 
The groovy puzzlers (as Presented at JavaOne 2014)
The groovy puzzlers (as Presented at JavaOne 2014)The groovy puzzlers (as Presented at JavaOne 2014)
The groovy puzzlers (as Presented at JavaOne 2014)GroovyPuzzlers
 
Procedure To Store Database Object Size And Number Of Rows In Custom Table
Procedure To Store Database Object Size And Number Of Rows In Custom TableProcedure To Store Database Object Size And Number Of Rows In Custom Table
Procedure To Store Database Object Size And Number Of Rows In Custom TableAhmed Elshayeb
 

What's hot (20)

Functional perl
Functional perlFunctional perl
Functional perl
 
Swift에서 꼬리재귀 사용기 (Tail Recursion)
Swift에서 꼬리재귀 사용기 (Tail Recursion)Swift에서 꼬리재귀 사용기 (Tail Recursion)
Swift에서 꼬리재귀 사용기 (Tail Recursion)
 
News of the Symfony2 World
News of the Symfony2 WorldNews of the Symfony2 World
News of the Symfony2 World
 
The Perl6 Type System
The Perl6 Type SystemThe Perl6 Type System
The Perl6 Type System
 
The most exciting features of PHP 7.1
The most exciting features of PHP 7.1The most exciting features of PHP 7.1
The most exciting features of PHP 7.1
 
Building Your First Widget
Building Your First WidgetBuilding Your First Widget
Building Your First Widget
 
Symfony 2.0 on PHP 5.3
Symfony 2.0 on PHP 5.3Symfony 2.0 on PHP 5.3
Symfony 2.0 on PHP 5.3
 
Looping the Loop with SPL Iterators
Looping the Loop with SPL IteratorsLooping the Loop with SPL Iterators
Looping the Loop with SPL Iterators
 
Creating a compiler in Perl 6
Creating a compiler in Perl 6Creating a compiler in Perl 6
Creating a compiler in Perl 6
 
QNlocal: Docker, Continuous Integration, WordPress e milioni di visite. Si è ...
QNlocal: Docker, Continuous Integration, WordPress e milioni di visite. Si è ...QNlocal: Docker, Continuous Integration, WordPress e milioni di visite. Si è ...
QNlocal: Docker, Continuous Integration, WordPress e milioni di visite. Si è ...
 
Build a compiler in 2hrs - NCrafts Paris 2015
Build a compiler in 2hrs -  NCrafts Paris 2015Build a compiler in 2hrs -  NCrafts Paris 2015
Build a compiler in 2hrs - NCrafts Paris 2015
 
The hidden and new parts of JS
The hidden and new parts of JSThe hidden and new parts of JS
The hidden and new parts of JS
 
Get into the FLOW with Extbase
Get into the FLOW with ExtbaseGet into the FLOW with Extbase
Get into the FLOW with Extbase
 
01c shell
01c shell01c shell
01c shell
 
Unlocking Museum Systems with Open Source
Unlocking Museum Systems with Open SourceUnlocking Museum Systems with Open Source
Unlocking Museum Systems with Open Source
 
Perl5i
Perl5iPerl5i
Perl5i
 
Groovy every day
Groovy every dayGroovy every day
Groovy every day
 
ABAP EVENTS EXAMPLE
ABAP EVENTS EXAMPLEABAP EVENTS EXAMPLE
ABAP EVENTS EXAMPLE
 
The groovy puzzlers (as Presented at JavaOne 2014)
The groovy puzzlers (as Presented at JavaOne 2014)The groovy puzzlers (as Presented at JavaOne 2014)
The groovy puzzlers (as Presented at JavaOne 2014)
 
Procedure To Store Database Object Size And Number Of Rows In Custom Table
Procedure To Store Database Object Size And Number Of Rows In Custom TableProcedure To Store Database Object Size And Number Of Rows In Custom Table
Procedure To Store Database Object Size And Number Of Rows In Custom Table
 

Similar to pt-query-digest は Perl!!

Short Intro to PHP and MySQL
Short Intro to PHP and MySQLShort Intro to PHP and MySQL
Short Intro to PHP and MySQLJussi Pohjolainen
 
Beginner guide to mysql command line
Beginner guide to mysql command lineBeginner guide to mysql command line
Beginner guide to mysql command linePriti Solanki
 
LLVM Backend の紹介
LLVM Backend の紹介LLVM Backend の紹介
LLVM Backend の紹介Akira Maruoka
 
ZFConf 2010: Zend Framework & MVC, Model Implementation (Part 2, Dependency I...
ZFConf 2010: Zend Framework & MVC, Model Implementation (Part 2, Dependency I...ZFConf 2010: Zend Framework & MVC, Model Implementation (Part 2, Dependency I...
ZFConf 2010: Zend Framework & MVC, Model Implementation (Part 2, Dependency I...Kirill Chebunin
 
Overpsss API / Overpass-Turbo
Overpsss API / Overpass-TurboOverpsss API / Overpass-Turbo
Overpsss API / Overpass-TurboYu-Chin Tsai
 
Malware Detection with OSSEC HIDS - OSSECCON 2014
Malware Detection with OSSEC HIDS - OSSECCON 2014Malware Detection with OSSEC HIDS - OSSECCON 2014
Malware Detection with OSSEC HIDS - OSSECCON 2014Santiago Bassett
 
Gift-VT Tools Development Overview
Gift-VT Tools Development OverviewGift-VT Tools Development Overview
Gift-VT Tools Development Overviewstn_tkiller
 
pg_proctab: Accessing System Stats in PostgreSQL
pg_proctab: Accessing System Stats in PostgreSQLpg_proctab: Accessing System Stats in PostgreSQL
pg_proctab: Accessing System Stats in PostgreSQLMark Wong
 
pg_proctab: Accessing System Stats in PostgreSQL
pg_proctab: Accessing System Stats in PostgreSQLpg_proctab: Accessing System Stats in PostgreSQL
pg_proctab: Accessing System Stats in PostgreSQLCommand Prompt., Inc
 
pg_proctab: Accessing System Stats in PostgreSQL
pg_proctab: Accessing System Stats in PostgreSQLpg_proctab: Accessing System Stats in PostgreSQL
pg_proctab: Accessing System Stats in PostgreSQLMark Wong
 
Sydney Oracle Meetup - access paths
Sydney Oracle Meetup - access pathsSydney Oracle Meetup - access paths
Sydney Oracle Meetup - access pathspaulguerin
 
Python And GIS - Beyond Modelbuilder And Pythonwin
Python And GIS - Beyond Modelbuilder And PythonwinPython And GIS - Beyond Modelbuilder And Pythonwin
Python And GIS - Beyond Modelbuilder And PythonwinChad Cooper
 
Create a web-app with Cgi Appplication
Create a web-app with Cgi AppplicationCreate a web-app with Cgi Appplication
Create a web-app with Cgi Appplicationolegmmiller
 
Simple Ways To Be A Better Programmer (OSCON 2007)
Simple Ways To Be A Better Programmer (OSCON 2007)Simple Ways To Be A Better Programmer (OSCON 2007)
Simple Ways To Be A Better Programmer (OSCON 2007)Michael Schwern
 
Extending MySQL Enterprise Monitor
Extending MySQL Enterprise MonitorExtending MySQL Enterprise Monitor
Extending MySQL Enterprise MonitorMark Leith
 
Automate sap security user audit
Automate sap security user auditAutomate sap security user audit
Automate sap security user auditSatyajit Deb
 
Developing Information Schema Plugins
Developing Information Schema PluginsDeveloping Information Schema Plugins
Developing Information Schema PluginsMark Leith
 

Similar to pt-query-digest は Perl!! (20)

Pro PostgreSQL
Pro PostgreSQLPro PostgreSQL
Pro PostgreSQL
 
Short Intro to PHP and MySQL
Short Intro to PHP and MySQLShort Intro to PHP and MySQL
Short Intro to PHP and MySQL
 
Beginner guide to mysql command line
Beginner guide to mysql command lineBeginner guide to mysql command line
Beginner guide to mysql command line
 
LLVM Backend の紹介
LLVM Backend の紹介LLVM Backend の紹介
LLVM Backend の紹介
 
ZFConf 2010: Zend Framework & MVC, Model Implementation (Part 2, Dependency I...
ZFConf 2010: Zend Framework & MVC, Model Implementation (Part 2, Dependency I...ZFConf 2010: Zend Framework & MVC, Model Implementation (Part 2, Dependency I...
ZFConf 2010: Zend Framework & MVC, Model Implementation (Part 2, Dependency I...
 
Overpsss API / Overpass-Turbo
Overpsss API / Overpass-TurboOverpsss API / Overpass-Turbo
Overpsss API / Overpass-Turbo
 
Malware Detection with OSSEC HIDS - OSSECCON 2014
Malware Detection with OSSEC HIDS - OSSECCON 2014Malware Detection with OSSEC HIDS - OSSECCON 2014
Malware Detection with OSSEC HIDS - OSSECCON 2014
 
Explain
ExplainExplain
Explain
 
Gift-VT Tools Development Overview
Gift-VT Tools Development OverviewGift-VT Tools Development Overview
Gift-VT Tools Development Overview
 
pg_proctab: Accessing System Stats in PostgreSQL
pg_proctab: Accessing System Stats in PostgreSQLpg_proctab: Accessing System Stats in PostgreSQL
pg_proctab: Accessing System Stats in PostgreSQL
 
pg_proctab: Accessing System Stats in PostgreSQL
pg_proctab: Accessing System Stats in PostgreSQLpg_proctab: Accessing System Stats in PostgreSQL
pg_proctab: Accessing System Stats in PostgreSQL
 
pg_proctab: Accessing System Stats in PostgreSQL
pg_proctab: Accessing System Stats in PostgreSQLpg_proctab: Accessing System Stats in PostgreSQL
pg_proctab: Accessing System Stats in PostgreSQL
 
Sydney Oracle Meetup - access paths
Sydney Oracle Meetup - access pathsSydney Oracle Meetup - access paths
Sydney Oracle Meetup - access paths
 
Python And GIS - Beyond Modelbuilder And Pythonwin
Python And GIS - Beyond Modelbuilder And PythonwinPython And GIS - Beyond Modelbuilder And Pythonwin
Python And GIS - Beyond Modelbuilder And Pythonwin
 
Create a web-app with Cgi Appplication
Create a web-app with Cgi AppplicationCreate a web-app with Cgi Appplication
Create a web-app with Cgi Appplication
 
Simple Ways To Be A Better Programmer (OSCON 2007)
Simple Ways To Be A Better Programmer (OSCON 2007)Simple Ways To Be A Better Programmer (OSCON 2007)
Simple Ways To Be A Better Programmer (OSCON 2007)
 
Extending MySQL Enterprise Monitor
Extending MySQL Enterprise MonitorExtending MySQL Enterprise Monitor
Extending MySQL Enterprise Monitor
 
Automate sap security user audit
Automate sap security user auditAutomate sap security user audit
Automate sap security user audit
 
Developing Information Schema Plugins
Developing Information Schema PluginsDeveloping Information Schema Plugins
Developing Information Schema Plugins
 
ZFINDALLZPROGAM
ZFINDALLZPROGAMZFINDALLZPROGAM
ZFINDALLZPROGAM
 

More from Takafumi ONAKA

不正のトライアングルとコードベースの治安維持
不正のトライアングルとコードベースの治安維持不正のトライアングルとコードベースの治安維持
不正のトライアングルとコードベースの治安維持Takafumi ONAKA
 
技術記事を書く&楽しむチームの作り方
技術記事を書く&楽しむチームの作り方技術記事を書く&楽しむチームの作り方
技術記事を書く&楽しむチームの作り方Takafumi ONAKA
 
グルーミングしながら進めるプロダクト開発
グルーミングしながら進めるプロダクト開発グルーミングしながら進めるプロダクト開発
グルーミングしながら進めるプロダクト開発Takafumi ONAKA
 
エンジニアの個人ブランディングと技術組織
エンジニアの個人ブランディングと技術組織エンジニアの個人ブランディングと技術組織
エンジニアの個人ブランディングと技術組織Takafumi ONAKA
 
Hatena::Letの式年遷宮
Hatena::Letの式年遷宮Hatena::Letの式年遷宮
Hatena::Letの式年遷宮Takafumi ONAKA
 
アプリケーションを作るときに考える25のこと
アプリケーションを作るときに考える25のことアプリケーションを作るときに考える25のこと
アプリケーションを作るときに考える25のことTakafumi ONAKA
 
cpanfileがRubyでパースできることに気づいた俺たちは
cpanfileがRubyでパースできることに気づいた俺たちはcpanfileがRubyでパースできることに気づいた俺たちは
cpanfileがRubyでパースできることに気づいた俺たちはTakafumi ONAKA
 
Perl使いの国のRubyist
Perl使いの国のRubyistPerl使いの国のRubyist
Perl使いの国のRubyistTakafumi ONAKA
 
ApplicationTemplateのススメ
ApplicationTemplateのススメApplicationTemplateのススメ
ApplicationTemplateのススメTakafumi ONAKA
 
ふつうのRailsアプリケーション開発
ふつうのRailsアプリケーション開発ふつうのRailsアプリケーション開発
ふつうのRailsアプリケーション開発Takafumi ONAKA
 
クローズドソースから始めるオープンソース
クローズドソースから始めるオープンソースクローズドソースから始めるオープンソース
クローズドソースから始めるオープンソースTakafumi ONAKA
 
「速」を落とさないコードレビュー
「速」を落とさないコードレビュー「速」を落とさないコードレビュー
「速」を落とさないコードレビューTakafumi ONAKA
 
短期間で新技術を学ぶ技術
短期間で新技術を学ぶ技術短期間で新技術を学ぶ技術
短期間で新技術を学ぶ技術Takafumi ONAKA
 
ドリコム×ピクシブ 社会人交換留学説明資料
ドリコム×ピクシブ 社会人交換留学説明資料ドリコム×ピクシブ 社会人交換留学説明資料
ドリコム×ピクシブ 社会人交換留学説明資料Takafumi ONAKA
 
マジカルsvnとキュアgit
マジカルsvnとキュアgitマジカルsvnとキュアgit
マジカルsvnとキュアgitTakafumi ONAKA
 
Github Enterprise じゃなくてもいいじゃん
Github Enterprise じゃなくてもいいじゃんGithub Enterprise じゃなくてもいいじゃん
Github Enterprise じゃなくてもいいじゃんTakafumi ONAKA
 
ターミナルで画像確認するヤツ作った
ターミナルで画像確認するヤツ作ったターミナルで画像確認するヤツ作った
ターミナルで画像確認するヤツ作ったTakafumi ONAKA
 

More from Takafumi ONAKA (20)

不正のトライアングルとコードベースの治安維持
不正のトライアングルとコードベースの治安維持不正のトライアングルとコードベースの治安維持
不正のトライアングルとコードベースの治安維持
 
技術記事を書く&楽しむチームの作り方
技術記事を書く&楽しむチームの作り方技術記事を書く&楽しむチームの作り方
技術記事を書く&楽しむチームの作り方
 
グルーミングしながら進めるプロダクト開発
グルーミングしながら進めるプロダクト開発グルーミングしながら進めるプロダクト開発
グルーミングしながら進めるプロダクト開発
 
エンジニアの個人ブランディングと技術組織
エンジニアの個人ブランディングと技術組織エンジニアの個人ブランディングと技術組織
エンジニアの個人ブランディングと技術組織
 
Hatena::Letの式年遷宮
Hatena::Letの式年遷宮Hatena::Letの式年遷宮
Hatena::Letの式年遷宮
 
アプリケーションを作るときに考える25のこと
アプリケーションを作るときに考える25のことアプリケーションを作るときに考える25のこと
アプリケーションを作るときに考える25のこと
 
cpanfileがRubyでパースできることに気づいた俺たちは
cpanfileがRubyでパースできることに気づいた俺たちはcpanfileがRubyでパースできることに気づいた俺たちは
cpanfileがRubyでパースできることに気づいた俺たちは
 
Perl使いの国のRubyist
Perl使いの国のRubyistPerl使いの国のRubyist
Perl使いの国のRubyist
 
ApplicationTemplateのススメ
ApplicationTemplateのススメApplicationTemplateのススメ
ApplicationTemplateのススメ
 
RSpecしぐさ
RSpecしぐさRSpecしぐさ
RSpecしぐさ
 
ふつうのRailsアプリケーション開発
ふつうのRailsアプリケーション開発ふつうのRailsアプリケーション開発
ふつうのRailsアプリケーション開発
 
クローズドソースから始めるオープンソース
クローズドソースから始めるオープンソースクローズドソースから始めるオープンソース
クローズドソースから始めるオープンソース
 
「速」を落とさないコードレビュー
「速」を落とさないコードレビュー「速」を落とさないコードレビュー
「速」を落とさないコードレビュー
 
短期間で新技術を学ぶ技術
短期間で新技術を学ぶ技術短期間で新技術を学ぶ技術
短期間で新技術を学ぶ技術
 
Application Bootstrap
Application BootstrapApplication Bootstrap
Application Bootstrap
 
ドリコム×ピクシブ 社会人交換留学説明資料
ドリコム×ピクシブ 社会人交換留学説明資料ドリコム×ピクシブ 社会人交換留学説明資料
ドリコム×ピクシブ 社会人交換留学説明資料
 
すこやかRails
すこやかRailsすこやかRails
すこやかRails
 
マジカルsvnとキュアgit
マジカルsvnとキュアgitマジカルsvnとキュアgit
マジカルsvnとキュアgit
 
Github Enterprise じゃなくてもいいじゃん
Github Enterprise じゃなくてもいいじゃんGithub Enterprise じゃなくてもいいじゃん
Github Enterprise じゃなくてもいいじゃん
 
ターミナルで画像確認するヤツ作った
ターミナルで画像確認するヤツ作ったターミナルで画像確認するヤツ作った
ターミナルで画像確認するヤツ作った
 

Recently uploaded

How to convert PDF to text with Nanonets
How to convert PDF to text with NanonetsHow to convert PDF to text with Nanonets
How to convert PDF to text with Nanonetsnaman860154
 
[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdfhans926745
 
The Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptxThe Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptxMalak Abu Hammad
 
FULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | Delhi
FULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | DelhiFULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | Delhi
FULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | Delhisoniya singh
 
Injustice - Developers Among Us (SciFiDevCon 2024)
Injustice - Developers Among Us (SciFiDevCon 2024)Injustice - Developers Among Us (SciFiDevCon 2024)
Injustice - Developers Among Us (SciFiDevCon 2024)Allon Mureinik
 
Kalyanpur ) Call Girls in Lucknow Finest Escorts Service 🍸 8923113531 🎰 Avail...
Kalyanpur ) Call Girls in Lucknow Finest Escorts Service 🍸 8923113531 🎰 Avail...Kalyanpur ) Call Girls in Lucknow Finest Escorts Service 🍸 8923113531 🎰 Avail...
Kalyanpur ) Call Girls in Lucknow Finest Escorts Service 🍸 8923113531 🎰 Avail...gurkirankumar98700
 
A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)Gabriella Davis
 
Boost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivityBoost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivityPrincipled Technologies
 
The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024Rafal Los
 
08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking Men08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking MenDelhi Call girls
 
SQL Database Design For Developers at php[tek] 2024
SQL Database Design For Developers at php[tek] 2024SQL Database Design For Developers at php[tek] 2024
SQL Database Design For Developers at php[tek] 2024Scott Keck-Warren
 
Maximizing Board Effectiveness 2024 Webinar.pptx
Maximizing Board Effectiveness 2024 Webinar.pptxMaximizing Board Effectiveness 2024 Webinar.pptx
Maximizing Board Effectiveness 2024 Webinar.pptxOnBoard
 
Presentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreterPresentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreternaman860154
 
Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024BookNet Canada
 
Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024The Digital Insurer
 
Enhancing Worker Digital Experience: A Hands-on Workshop for Partners
Enhancing Worker Digital Experience: A Hands-on Workshop for PartnersEnhancing Worker Digital Experience: A Hands-on Workshop for Partners
Enhancing Worker Digital Experience: A Hands-on Workshop for PartnersThousandEyes
 
🐬 The future of MySQL is Postgres 🐘
🐬  The future of MySQL is Postgres   🐘🐬  The future of MySQL is Postgres   🐘
🐬 The future of MySQL is Postgres 🐘RTylerCroy
 
Google AI Hackathon: LLM based Evaluator for RAG
Google AI Hackathon: LLM based Evaluator for RAGGoogle AI Hackathon: LLM based Evaluator for RAG
Google AI Hackathon: LLM based Evaluator for RAGSujit Pal
 
Scaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organizationScaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organizationRadu Cotescu
 
Handwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed textsHandwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed textsMaria Levchenko
 

Recently uploaded (20)

How to convert PDF to text with Nanonets
How to convert PDF to text with NanonetsHow to convert PDF to text with Nanonets
How to convert PDF to text with Nanonets
 
[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf
 
The Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptxThe Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptx
 
FULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | Delhi
FULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | DelhiFULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | Delhi
FULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | Delhi
 
Injustice - Developers Among Us (SciFiDevCon 2024)
Injustice - Developers Among Us (SciFiDevCon 2024)Injustice - Developers Among Us (SciFiDevCon 2024)
Injustice - Developers Among Us (SciFiDevCon 2024)
 
Kalyanpur ) Call Girls in Lucknow Finest Escorts Service 🍸 8923113531 🎰 Avail...
Kalyanpur ) Call Girls in Lucknow Finest Escorts Service 🍸 8923113531 🎰 Avail...Kalyanpur ) Call Girls in Lucknow Finest Escorts Service 🍸 8923113531 🎰 Avail...
Kalyanpur ) Call Girls in Lucknow Finest Escorts Service 🍸 8923113531 🎰 Avail...
 
A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)
 
Boost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivityBoost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivity
 
The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024
 
08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking Men08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking Men
 
SQL Database Design For Developers at php[tek] 2024
SQL Database Design For Developers at php[tek] 2024SQL Database Design For Developers at php[tek] 2024
SQL Database Design For Developers at php[tek] 2024
 
Maximizing Board Effectiveness 2024 Webinar.pptx
Maximizing Board Effectiveness 2024 Webinar.pptxMaximizing Board Effectiveness 2024 Webinar.pptx
Maximizing Board Effectiveness 2024 Webinar.pptx
 
Presentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreterPresentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreter
 
Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
 
Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024
 
Enhancing Worker Digital Experience: A Hands-on Workshop for Partners
Enhancing Worker Digital Experience: A Hands-on Workshop for PartnersEnhancing Worker Digital Experience: A Hands-on Workshop for Partners
Enhancing Worker Digital Experience: A Hands-on Workshop for Partners
 
🐬 The future of MySQL is Postgres 🐘
🐬  The future of MySQL is Postgres   🐘🐬  The future of MySQL is Postgres   🐘
🐬 The future of MySQL is Postgres 🐘
 
Google AI Hackathon: LLM based Evaluator for RAG
Google AI Hackathon: LLM based Evaluator for RAGGoogle AI Hackathon: LLM based Evaluator for RAG
Google AI Hackathon: LLM based Evaluator for RAG
 
Scaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organizationScaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organization
 
Handwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed textsHandwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed texts
 

pt-query-digest は Perl!!

  • 1.
  • 2.
  • 3.
  • 4. /* lib/Giga/Core/Repository/SeriesComment.pm at line 200 */ SELECT COUNT(*) FROM `series_comment` WHERE (`is_public` = '1') AND (`series_id` = ‘10834108156628842496');
 +----+-------------+-||-+-------+------------------------------------+ | id | select_type | || | rows | Extra | +----+-------------+-||-+-------+------------------------------------+ | 1 | SIMPLE | || | 30872 | Using index condition; Using where | +----+-------------+-||-+-------+------------------------------------+ 1 row in set (0.05 sec)
  • 5. /* lib/Giga/Core/Repository/SeriesComment.pm at line 200 */ SELECT COUNT(*) FROM `series_comment` WHERE (`series_id` = ‘10834108156628842496') AND (`is_public` = '1')G 
 /* lib/Giga/Core/Repository/SeriesComment.pm at line 200 */ SELECT COUNT(*) FROM `series_comment` WHERE (`is_public` = '1') AND (`series_id` = '10834108156628842496')G
  • 6.
  • 7.
  • 8. sub get_public_comments_count { args my $class => 'ClassName', my $series => 'Giga::Core::Model::Series', ; my $core_db = Giga::DB->new->core; return $core_db->count( 'series_comment', '*', +{ series_id => $series->id, is_public => 1, }, ); }
  • 9. my $w = $self->new_condition; my @w = ref $where eq 'ARRAY' ? @$where : %$where; while (my ($col, $val) = splice @w, 0, 2) { $w->add($col => $val); }
  • 10. return $core_db->count( 'series_comment', '*', - +{ + [ series_id => $series->id, is_public => 1, - }, + ], );
  • 11. return $core_db->count( 'series_comment', '*', - +{ + [ series_id => $series->id, is_public => 1, - }, + ], );
  • 12.
  • 13.
  • 14. #!/usr/bin/env perl # This program is part of Percona Toolkit: http://www.percona.com/soft # See "COPYRIGHT, LICENSE, AND WARRANTY" at the end of this file for l # notices and disclaimers. use strict; use warnings FATAL => 'all'; # This tool is "fat-packed": most of its dependent modules are embedde
  • 15. $ wc pt-query-digest 16920 64009 527581 pt-query-digest
  • 16. # This tool is "fat-packed": most of its dependent modules are embedded # in this file. Setting %INC to this file for each module makes Perl aware # of this so it will not try to load the module from @INC. See the tool's # documentation for a full list of dependencies.
  • 17. $query =~ s/["']//g; # quoted strings $query =~ s/".*?"/?/sg; # quoted strings $query =~ s/'.*?'/?/sg; # quoted strings $query =~ s/bfalseb|btrueb/?/isg; # boolean values ... $query =~ s/As+//; # Chop off leading whitespace chomp $query; # Kill trailing whitespace $query =~ tr[ ntrf][ ]s; # Collapse whitespace $query = lc $query; $query =~ s/bnullb/?/g; # Get rid of NULLs $query =~ s{ # Collapse IN and VALUES lists b(in|values?)(?:[s,]*([s?,]*))+ } {$1(?+)}gx;
  • 18.
  • 19. sub select_query { my ($self, $table, $fields, $where, $opt) = @_; if (ref($where) eq 'HASH') { $where = [map { ($_, $where->{$_}) } (sort keys %$where)]; } $self->SUPER::select_query($table, $fields, $where, $opt); }
  • 20. /* lib/Giga/Core/Repository/SeriesComment.pm at line 200 */ SELECT COUNT(*) FROM `series_comment` WHERE (`is_public` = '1') AND (`series_id` = '10834108156628842496')G