Editor's note: This article does not take by-elections for state assemblies or the Federal Legislative Council into consideration.
Tanjung Piai will go down in the record books as the worst performance for any ruling coalition in a parliamentary by-election.
Since 1959, a coalition ruling the federal government has averaged a 56.25 percent vote share in 61 by-elections which it participated in.
This figure does not consider contests where the ruling coalition abstained or won the by-election uncontested.
In the case of Tanjung Piai, the vote share by Pakatan Harapan was way below average at a mere 26.4 percent.
The second-worst record for a ruling coalition was in 1988 during the Johor Bahru by-election, which saw BN garnering just 29.8 percent of the vote.
However, it should be noted that in 1988, BN was facing internal strife after Umno was dissolved and was also facing the political backlash for Operasi Lalang.
There have been 72 parliamentary by-elections called since the first parliament was formed in 1959. BN and its predecessor, Alliance, won 50 of those contests (69.4 percent).
Of the 72 parliamentary by-elections, 25 occurred during the time Dr Mahathir Mohamad was prime minister.
Mahathir was prime minister between 1982 and 2003. During that period, he won five general elections. As the head of the Harapan coalition, he won another general election last year.
Overall, Mahathir has a 16-9 win-loss parliamentary by-election record (64 percent win rate) when he is in charge of a ruling coalition.
There was one instance (Lipis, 1997) where the ruling coalition (BN) won uncontested.
Throughout those 24 parliamentary by-elections which saw contest, the ruling coalition led by Mahathir averaged 54.37 percent of the vote share.
Of the four parliamentary by-elections held during Mahathir's second reign, the ruling coalition (Pakatan Harapan) averaged 53.54 percent of the vote share.
This means that vote share for the ruling coalition during Mahathir's current term is below his career average.
For comparison, Mahathir's predecessor Najib Abdul Razak's parliamentary by-election win-loss record stood at 6-2 (75 percent win rate), while Mahathir's successor Abdullah Ahmad Badawi scored three losses.