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

ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemkeProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemkeProduct Anonymous
 
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...DianaGray10
 
Apidays New York 2024 - The value of a flexible API Management solution for O...
Apidays New York 2024 - The value of a flexible API Management solution for O...Apidays New York 2024 - The value of a flexible API Management solution for O...
Apidays New York 2024 - The value of a flexible API Management solution for O...apidays
 
Introduction to Multilingual Retrieval Augmented Generation (RAG)
Introduction to Multilingual Retrieval Augmented Generation (RAG)Introduction to Multilingual Retrieval Augmented Generation (RAG)
Introduction to Multilingual Retrieval Augmented Generation (RAG)Zilliz
 
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers:  A Deep Dive into Serverless Spatial Data and FMECloud Frontiers:  A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FMESafe Software
 
CNIC Information System with Pakdata Cf In Pakistan
CNIC Information System with Pakdata Cf In PakistanCNIC Information System with Pakdata Cf In Pakistan
CNIC Information System with Pakdata Cf In Pakistandanishmna97
 
Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...
Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...
Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...apidays
 
ICT role in 21st century education and its challenges
ICT role in 21st century education and its challengesICT role in 21st century education and its challenges
ICT role in 21st century education and its challengesrafiqahmad00786416
 
Boost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdfBoost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdfsudhanshuwaghmare1
 
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024Victor Rentea
 
MS Copilot expands with MS Graph connectors
MS Copilot expands with MS Graph connectorsMS Copilot expands with MS Graph connectors
MS Copilot expands with MS Graph connectorsNanddeep Nachan
 
EMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWER
EMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWEREMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWER
EMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWERMadyBayot
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerThousandEyes
 
Exploring Multimodal Embeddings with Milvus
Exploring Multimodal Embeddings with MilvusExploring Multimodal Embeddings with Milvus
Exploring Multimodal Embeddings with MilvusZilliz
 
AWS Community Day CPH - Three problems of Terraform
AWS Community Day CPH - Three problems of TerraformAWS Community Day CPH - Three problems of Terraform
AWS Community Day CPH - Three problems of TerraformAndrey Devyatkin
 
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...apidays
 
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers:  A Deep Dive into Serverless Spatial Data and FMECloud Frontiers:  A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FMESafe Software
 
Corporate and higher education May webinar.pptx
Corporate and higher education May webinar.pptxCorporate and higher education May webinar.pptx
Corporate and higher education May webinar.pptxRustici Software
 

Recently uploaded (20)

ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemkeProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
 
Understanding the FAA Part 107 License ..
Understanding the FAA Part 107 License ..Understanding the FAA Part 107 License ..
Understanding the FAA Part 107 License ..
 
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
 
Apidays New York 2024 - The value of a flexible API Management solution for O...
Apidays New York 2024 - The value of a flexible API Management solution for O...Apidays New York 2024 - The value of a flexible API Management solution for O...
Apidays New York 2024 - The value of a flexible API Management solution for O...
 
Introduction to Multilingual Retrieval Augmented Generation (RAG)
Introduction to Multilingual Retrieval Augmented Generation (RAG)Introduction to Multilingual Retrieval Augmented Generation (RAG)
Introduction to Multilingual Retrieval Augmented Generation (RAG)
 
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers:  A Deep Dive into Serverless Spatial Data and FMECloud Frontiers:  A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
 
CNIC Information System with Pakdata Cf In Pakistan
CNIC Information System with Pakdata Cf In PakistanCNIC Information System with Pakdata Cf In Pakistan
CNIC Information System with Pakdata Cf In Pakistan
 
Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...
Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...
Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...
 
ICT role in 21st century education and its challenges
ICT role in 21st century education and its challengesICT role in 21st century education and its challenges
ICT role in 21st century education and its challenges
 
Boost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdfBoost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdf
 
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024
 
MS Copilot expands with MS Graph connectors
MS Copilot expands with MS Graph connectorsMS Copilot expands with MS Graph connectors
MS Copilot expands with MS Graph connectors
 
EMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWER
EMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWEREMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWER
EMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWER
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected Worker
 
Exploring Multimodal Embeddings with Milvus
Exploring Multimodal Embeddings with MilvusExploring Multimodal Embeddings with Milvus
Exploring Multimodal Embeddings with Milvus
 
AWS Community Day CPH - Three problems of Terraform
AWS Community Day CPH - Three problems of TerraformAWS Community Day CPH - Three problems of Terraform
AWS Community Day CPH - Three problems of Terraform
 
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
 
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
 
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers:  A Deep Dive into Serverless Spatial Data and FMECloud Frontiers:  A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
 
Corporate and higher education May webinar.pptx
Corporate and higher education May webinar.pptxCorporate and higher education May webinar.pptx
Corporate and higher education May webinar.pptx
 

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