Time complexity can be identified based on the input size of a problem with respect to the time required to solve that problem. In simple, total time required by the algorithm to process the given input. Constraints will give you basic idea about the size of input

Time Complexity hierarchy:

O(1) is less time. 

O(n!) is Maximum time

O(1) < O(log n) < O(sqrt(n)) < O(n) < O(n log n) < O(n2) < O(n3) < O(2n) < O(n!)


O(1) – Constant Time Complexity.

It does not matter, how many input elements a problem have, it takes constant number of steps to solve the problem.

Examples for Constant time complexity:

1. a[1000] contains 1000 elements, it takes same time to access the 10th element and 999th element. So, it is constant time complexity.

2. a++; // Constant complexity to calculate this statement.

3. C=a+b; // Constant complexity to calculate this statement.

4. Push and Pop operations in stack

5. Insert and Remove from Queue

Example C++ Code for O(1) complexity

#include <bits/stdc++.h>

using namespace std;

int main(){
 cout << "programming9.com" << "\n";
}

 Example Java Code for O(1) complexity

public class Print {
	public static void main(String[] args) {
		System.out.println("programming9.com");
	}
}

O(log n) – Logarithmic Time complexity

In every step, halves the input size in logarithmic algorithm, log2 n is equals to the number of times n must be divided by 2 to get 1.

Let us take an array with 16 elements input size, that is - log2 16

step 1: 16/2 = 8 will become input size

step 2: 8/2 = 4 will become input size

step 3: 4/2 =2 will become input size

step 4: 2/2 =1 calculation completed.

The calculation will be performed till we get a value 1.

Still not understood? see the example.

Example algorithms for Logarithmic Complexity:

Binary Search Algorithm contains 16 sorted elements, [1, 2, 3 ,4 , 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16], we need to find key value 16.

Step 1: 16/2 = 8, we need 16, it is right array, so leave all the left side half. that is, [9, 10, 11, 12, 13, 14, 15, 16]

Step 2: 8/2 = 4, we need 16, it is right array, so leave all the left side half again. that is, [13, 14, 15, 16]

Step 3: 4/2 = 2, we need 16, it is right array, so leave all the left side half again. that is, [15, 16]

Step 4: 2/2 =1, we found the value 16, return and exit.

 So, instead of searching element by element sequentially, we found the required value in 4 steps. If we do sequential search, it takes 16 steps to find the last element. Total elements are 16, we can complete search in 4 steps. 24 = 16

, that is log2 16.


O(n) = Linear Complexity

The number of steps and time required to solve a problem is based on input size. If you want to print a statement for n number of times, it is a linear complexity. Linear Search is an example for Linear Time Complexity.

C++ Code for Linear Complexity

#include <bits/stdc++.h>

using namespace std;

int main()
{
    for (int i = 1; i <= 10; i++) // input size is 10 (Assume that as n)
        cout << "programming9.com" << "\n";
}

 Example Java Code for Linear Complexity

public class Print {
	public static void main(String[] args) {
		for (int i = 1; i <= 10; i++) // input size is 10 (Assume that as n)
			System.out.println("programming9.com");
	}

}

if n value is 10, the loop repeats 10 times.

If n value is 1000, the loop takes 1000 times.

still there are other cases:

The following loop executes 2n times, still it is O(n) complexity.

#include <bits/stdc++.h>

using namespace std;

int main()
{
    int n=10;
    for (int i = 1; i <= 2*n; i++)
        cout << "programming9.com" << "\n";
}

The following loop executes n+5 times, still it is O(n) complexity.

#include <bits/stdc++.h>

using namespace std;

int main()
{
    int n=10;
    for (int i = 1; i <= n+5; i++)
        cout << "programming9.com" << "\n";
}

The following loop executes n/2 times, still it is O(n) complexity.

#include <bits/stdc++.h>

using namespace std;

int main()
{
    int n=10;
    for (int i = 1; i <= n; i+=2)
        cout << "programming9.com" << "\n";
}

O(n log n) - (n * log n) complexity

Divide and Conquer algorithms are generally considered under n log n time complexity. 

Ex:

Merge Sort Algorithm

Heap Sort Algorithm

Quick Sort Algorithm (Best and Average Case)


O(n^2) – Quadratic time complexity

If we use nested loop, that means a loop with in an another loop, is a quadratic complexity.

Outer loop runs n number of times, inner loop runs n*n number of times, that is O(n2).

#include <bits/stdc++.h>

using namespace std;

int main()
{
    int n=3;
    for (int i = 1; i <= n; i++)
            for (int i = 1; i <= n; i++)
                cout << "programming9.com" << "\n";
}
// the program prints programming9.com 9 times.

See other cases:

The below code contains n, n2 and n running times. But still it is O(n2) complexity, because that is maximum.

//Overall Complexity of the code is O(n^2)
#include <bits/stdc++.h>

using namespace std;

int main()
{
    int n=3;
    for (int i = 1; i <= n; i++) //O(n)
        cout << "loop 1" << "\n";

    for (int i = 1; i <= n; i++) //O(n^2)
        for (int i = 1; i <= n; i++)
            cout << "programming9.com - nested loop" << "\n";

    for (int i = 1; i <= n; i++) //O(n)
        cout << "loop 2" << "\n";

}

Ex:

Bubble Sort Algorithm

Selection Sort Algorithm

Insertion Sort Algorithm

Quick Sort Worst Case complexity is O(n^2)

In some cases, the time complexity is based on multiple variables, the following code contains two different variables n and m.

So the complexity is O(nm).

#include <bits/stdc++.h>

using namespace std;

int main()
{
    int n=3, m=2;
    for (int i = 1; i <= n; i++) //O(nm)
        for (int i = 1; i <= m; i++)
            cout << "programming9.com - nested loop" << "\n";
}

O(n^3) – A Cubic complexity

In quadratic algorithm, we used two nested loops. In cubic algorithm we use three nested loops.

#include <bits/stdc++.h>

using namespace std;

int main()
{
    int n=2;
    for (int i = 1; i <= n; i++) //O(n^3) time complexity
        for (int j = 1; j <= n; j++)
            for (int k = 1; k <= n; k++)
                cout << "programming9.com - This line prints 8 times" << "\n";
}

O(1), O(log n), O(n), O(n log n), O(n2), O(n3) all the complexities are polynomials.


O(2^n) – Subset of input elements.

The algorithm must run through all possible subsets of given input.

Ex:

{A, B, C} – possibilities of subsets are 2^3

{ }, {A}, {B}, {C}, {A,B}, {A, C}, {B,C}, {A,B,C}

 

{1,2,3,4} – Possibilities of subsets are 2^4

{ }, {1}, {2},{3},{4},{1,2},{1,3},{1,4},{2,3},{2,4},{3,4},{1,2,3},{1,2,4},{1,3,4},{2,3,4},{1,2,3,4}


O(n!) – Factorial complexity

All permutations of input elements.

If given input is {1,2,3}

The permutations are: (1,2,3), (1,3,2), (2,1,3), (2,3,1), (3,1,2), (3,2,1)


In online coding websites like Codechef, Hackerrank and Codeforces, and on any other competitions, the maximum execution time is 1 Second.

Within that short duration, if input elements are less than 10, we can choose non-polynomial algorithms.

If Input size is a lot bigger, we don’t have any other choice except to solve the problem using O(1) or O(n log n) or O(n).

If you use any other algorithm with O(n2) or more, you will face Time Limit Exceeded.

 

The following table shows the basic idea about the number of elements and associated time complexity. You have a big input size with 5000 elements, you are writing your code with O(n3) complexity. It is of no use, you will get time limit exceeded error even though your logic is correct.


 Input Size (n)  Time Complexity
 If less than 11 input elements  O(n!)
 If less than 24 input elements  O(2n)
 If less than 300 input elements  O(n3)
 If less than 5000 input elements  O(n2)
 If less than 106 input elements  O(n log n)
 If less than 107 input elements

 O(n)

 If less than 210^7 input elements O(log n)

Better to find optimized algorithms for the same problems. Definitely we have various solutions for same problem. 

6MBMemory Usage113msRequest Duration
Joomla! Version4.2.5
PHP Version7.4.33
Identityguest
Response200
Templateg5_helium
Database
Server
mysql
Version
5.7.23-23
Collation
utf8_unicode_ci
Conn Collation
utf8mb4_general_ci
$_GET
[]
$_POST
[]
$_SESSION
[]
$_COOKIE
[]
$_SERVER
array:87 [ "LSPHP_ENABLE_USER_INI" => "on" "PATH" => "/usr/local/bin:/usr/bin:/bin" "TEMP" => ...
session
array:3 [ "counter" => 1 "timer" => array:3 [ "start" => 1746713557 "last" => 1746713557...
registry
array:3 [ "data" => [] "initialized" => false "separator" => "." ]
user
array:18 [ "id" => 0 "name" => null "username" => null "email" => null "password" => "***r...
PHPDEBUGBAR_STACK_DATA
[]
  • afterLoad (552.78KB) (5.57ms)
  • afterInitialise (1.5MB) (20.75ms)
  • afterRoute (825.97KB) (16.82ms)
  • beforeRenderComponent com_content (138.81KB) (1.54ms)
  • Before Access::preloadComponents (all components) (55.55KB) (1.05ms)
  • After Access::preloadComponents (all components) (121KB) (1.02ms)
  • Before Access::preloadPermissions (com_content) (3.88KB) (21μs)
  • After Access::preloadPermissions (com_content) (256.8KB) (1.45ms)
  • Before Access::getAssetRules (id:1164 name:com_content.article.404) (18.8KB) (30μs)
  • After Access::getAssetRules (id:1164 name:com_content.article.404) (8.66KB) (175μs)
  • afterRenderComponent com_content (572.4KB) (13.9ms)
  • afterDispatch (2.25KB) (103μs)
  • beforeRenderRawModule mod_search (Search) (1.14MB) (14.72ms)
  • afterRenderRawModule mod_search (Search) (281.55KB) (3.39ms)
  • beforeRenderModule mod_search (Search) (704B) (9μs)
  • afterRenderModule mod_search (Search) (3.43KB) (175μs)
  • beforeRenderRawModule mod_articles_latest (Competitive Programming) (47.62KB) (1.33ms)
  • Before Access::getAssetRules (id:8 name:com_content) (119.03KB) (987μs)
  • After Access::getAssetRules (id:8 name:com_content) (1.59KB) (13μs)
  • afterRenderRawModule mod_articles_latest (Competitive Programming) (37.2KB) (3.12ms)
  • beforeRenderModule mod_articles_latest (Competitive Programming) (344B) (8μs)
  • afterRenderModule mod_articles_latest (Competitive Programming) (5.95KB) (119μs)
  • beforeRenderRawModule mod_jbounce (JBounce) (2.63KB) (50μs)
  • afterRenderRawModule mod_jbounce (JBounce) (2.5KB) (96μs)
  • beforeRenderModule mod_jbounce (JBounce) (720B) (4μs)
  • afterRenderModule mod_jbounce (JBounce) (1.28KB) (87μs)
  • afterRender (312.45KB) (16.83ms)
  • 1 x afterInitialise (1.5MB) (18.36%)
    20.75ms
    1 x afterRender (312.45KB) (14.89%)
    16.83ms
    1 x afterRoute (825.97KB) (14.88%)
    16.82ms
    1 x beforeRenderRawModule mod_search (Search) (1.14MB) (13.03%)
    14.72ms
    1 x afterRenderComponent com_content (572.4KB) (12.3%)
    13.90ms
    1 x afterLoad (552.78KB) (4.93%)
    5.57ms
    1 x afterRenderRawModule mod_search (Search) (281.55KB) (3%)
    3.39ms
    1 x afterRenderRawModule mod_articles_latest (Competitive Programming) (37.2KB) (2.76%)
    3.12ms
    1 x beforeRenderComponent com_content (138.81KB) (1.36%)
    1.54ms
    1 x After Access::preloadPermissions (com_content) (256.8KB) (1.28%)
    1.45ms
    1 x beforeRenderRawModule mod_articles_latest (Competitive Programming) (47.62KB) (1.18%)
    1.33ms
    1 x Before Access::preloadComponents (all components) (55.55KB) (0.93%)
    1.05ms
    1 x After Access::preloadComponents (all components) (121KB) (0.9%)
    1.02ms
    1 x Before Access::getAssetRules (id:8 name:com_content) (119.03KB) (0.87%)
    987μs
    1 x After Access::getAssetRules (id:1164 name:com_content.article.404) (8.66KB) (0.15%)
    175μs
    1 x afterRenderModule mod_search (Search) (3.43KB) (0.15%)
    175μs
    1 x afterRenderModule mod_articles_latest (Competitive Programming) (5.95KB) (0.11%)
    119μs
    1 x afterDispatch (2.25KB) (0.09%)
    103μs
    1 x afterRenderRawModule mod_jbounce (JBounce) (2.5KB) (0.09%)
    96μs
    1 x afterRenderModule mod_jbounce (JBounce) (1.28KB) (0.08%)
    87μs
    1 x beforeRenderRawModule mod_jbounce (JBounce) (2.63KB) (0.04%)
    50μs
    1 x Before Access::getAssetRules (id:1164 name:com_content.article.404) (18.8KB) (0.03%)
    30μs
    1 x Before Access::preloadPermissions (com_content) (3.88KB) (0.02%)
    21μs
    1 x After Access::getAssetRules (id:8 name:com_content) (1.59KB) (0.01%)
    13μs
    1 x beforeRenderModule mod_search (Search) (704B) (0.01%)
    9μs
    1 x beforeRenderModule mod_articles_latest (Competitive Programming) (344B) (0.01%)
    8μs
    1 x beforeRenderModule mod_jbounce (JBounce) (720B) (0%)
    4μs
34 statements were executed, 5 of which were duplicates, 29 unique12.08ms417.26KB
  • SELECT @@SESSION.sql_mode;94μs1.59KB/libraries/vendor/joomla/database/src/Mysqli/MysqliDriver.php:293Copy
  • SELECT `data` FROM `joom_session` WHERE `session_id` = ?140μs1.61KBParams/libraries/vendor/joomla/session/src/Handler/DatabaseHandler.php:261Copy
  • SELECT `session_id` FROM `joom_session` WHERE `session_id` = :session_id LIMIT 1126μs1.61KBParams/libraries/src/Session/MetadataManager.php:187Copy
  • INSERT INTO `joom_session` (`session_id`,`guest`,`time`,`userid`,`username`,`client_id`) VALUES (:session_id, :guest, :time, :user_id, :username, :client_id)179μs944BParams/libraries/src/Session/MetadataManager.php:260Copy
  • SELECT `extension_id` AS `id`,`element` AS `option`,`params`,`enabled` FROM `joom_extensions` WHERE `type` = 'component' AND `state` = 0 AND `enabled` = 1321μs4.73KB/libraries/src/Component/ComponentHelper.php:393Copy
  • SELECT `id`,`rules` FROM `joom_viewlevels`107μs1.06KB/libraries/src/Access/Access.php:955Copy
  • SELECT `b`.`id` FROM `joom_usergroups` AS `a` LEFT JOIN `joom_usergroups` AS `b` ON `b`.`lft` <= `a`.`lft` AND `b`.`rgt` >= `a`.`rgt` WHERE `a`.`id` = :guest174μs1.67KBParams/libraries/src/Access/Access.php:868Copy
  • SELECT `folder` AS `type`,`element` AS `name`,`params` AS `params`,`extension_id` AS `id` FROM `joom_extensions` WHERE `enabled` = 1 AND `type` = 'plugin' AND `state` IN (0,1) AND `access` IN (:preparedArray1,:preparedArray2) ORDER BY `ordering`592μs11.8KBParams/libraries/src/Plugin/PluginHelper.php:283Copy
  • SELECT `m`.`id`,`m`.`menutype`,`m`.`title`,`m`.`alias`,`m`.`note`,`m`.`link`,`m`.`type`,`m`.`level`,`m`.`language`,`m`.`browserNav`,`m`.`access`,`m`.`params`,`m`.`home`,`m`.`img`,`m`.`template_style_id`,`m`.`component_id`,`m`.`parent_id`,`m`.`path` AS `route`,`e`.`element` AS `component` FROM `joom_menu` AS `m` LEFT JOIN `joom_extensions` AS `e` ON `m`.`component_id` = `e`.`extension_id` WHERE ( (`m`.`published` = 1 AND `m`.`parent_id` > 0 AND `m`.`client_id` = 0) AND (`m`.`publish_up` IS NULL OR `m`.`publish_up` <= :currentDate1)) AND (`m`.`publish_down` IS NULL OR `m`.`publish_down` >= :currentDate2) ORDER BY `m`.`lft`539μs46.23KBParams/libraries/src/Menu/SiteMenu.php:166Copy
  • SELECT `c`.`id`,`c`.`asset_id`,`c`.`access`,`c`.`alias`,`c`.`checked_out`,`c`.`checked_out_time`,`c`.`created_time`,`c`.`created_user_id`,`c`.`description`,`c`.`extension`,`c`.`hits`,`c`.`language`,`c`.`level`,`c`.`lft`,`c`.`metadata`,`c`.`metadesc`,`c`.`metakey`,`c`.`modified_time`,`c`.`note`,`c`.`params`,`c`.`parent_id`,`c`.`path`,`c`.`published`,`c`.`rgt`,`c`.`title`,`c`.`modified_user_id`,`c`.`version`, CASE WHEN CHAR_LENGTH(`c`.`alias`) != 0 THEN CONCAT_WS(':', `c`.`id`, `c`.`alias`) ELSE `c`.`id` END as `slug` FROM `joom_categories` AS `s` INNER JOIN `joom_categories` AS `c` ON (`s`.`lft` <= `c`.`lft` AND `c`.`lft` < `s`.`rgt`) OR (`c`.`lft` < `s`.`lft` AND `s`.`rgt` < `c`.`rgt`) WHERE (`c`.`extension` = :extension OR `c`.`extension` = 'system') AND `c`.`published` = 1 AND `s`.`id` = :id ORDER BY `c`.`lft`365μs6.62KBParams/libraries/src/Categories/Categories.php:360Copy
  • SELECT `id`,`home`,`template`,`s`.`params`,`inheritable`,`parent` FROM `joom_template_styles` AS `s` LEFT JOIN `joom_extensions` AS `e` ON `e`.`element` = `s`.`template` AND `e`.`type` = 'template' AND `e`.`client_id` = `s`.`client_id` WHERE `s`.`client_id` = 0 AND `e`.`enabled` = 1233μs1.47KB/administrator/components/com_templates/src/Model/StyleModel.php:771Copy
  • SELECT s.id, s.template, s.home, s.title AS long_title, s.params FROM joom_template_styles AS s WHERE s.client_id = 0 AND s.template = 'g5_helium' ORDER BY s.id174μs1.23KB/libraries/gantry5/src/classes/Gantry/Joomla/StyleHelper.php:69Copy
  • SELECT * FROM `joom_languages` WHERE `published` = 1 ORDER BY `ordering` ASC173μs2.44KB/libraries/src/Language/LanguageHelper.php:142Copy
  • SELECT `id`,`name`,`rules`,`parent_id` FROM `joom_assets` WHERE `name` IN (:preparedArray1,:preparedArray2,:preparedArray3,:preparedArray4,:preparedArray5,:preparedArray6,:preparedArray7,:preparedArray8,:preparedArray9,:preparedArray10,:preparedArray11,:preparedArray12,:preparedArray13,:preparedArray14,:preparedArray15,:preparedArray16,:preparedArray17,:preparedArray18,:preparedArray19,:preparedArray20,:preparedArray21,:preparedArray22,:preparedArray23,:preparedArray24,:preparedArray25,:preparedArray26,:preparedArray27,:preparedArray28,:preparedArray29,:preparedArray30,:preparedArray31,:preparedArray32,:preparedArray33,:preparedArray34,:preparedArray35,:preparedArray36,:preparedArray37,:preparedArray38,:preparedArray39,:preparedArray40,:preparedArray41)468μs10.25KBParams/libraries/src/Access/Access.php:357Copy
  • SELECT `id`,`name`,`rules`,`parent_id` FROM `joom_assets` WHERE `name` LIKE :asset OR `name` = :extension OR `parent_id` = 0758μs69.8KBParams/libraries/src/Access/Access.php:301Copy
  • SHOW FULL COLUMNS FROM `joom_content`380μs10.39KB/libraries/vendor/joomla/database/src/Mysqli/MysqliDriver.php:584Copy
  • UPDATE joom_content SET `hits` = (`hits` + 1) WHERE `id` = '404'187μs2.55KB/libraries/src/Table/Table.php:1319Copy
  • SELECT `a`.`id`,`a`.`asset_id`,`a`.`title`,`a`.`alias`,`a`.`introtext`,`a`.`fulltext`,`a`.`state`,`a`.`catid`,`a`.`created`,`a`.`created_by`,`a`.`created_by_alias`,`a`.`modified`,`a`.`modified_by`,`a`.`checked_out`,`a`.`checked_out_time`,`a`.`publish_up`,`a`.`publish_down`,`a`.`images`,`a`.`urls`,`a`.`attribs`,`a`.`version`,`a`.`ordering`,`a`.`metakey`,`a`.`metadesc`,`a`.`access`,`a`.`hits`,`a`.`metadata`,`a`.`featured`,`a`.`language`,`fp`.`featured_up`,`fp`.`featured_down`,`c`.`title` AS `category_title`,`c`.`alias` AS `category_alias`,`c`.`access` AS `category_access`,`c`.`language` AS `category_language`,`fp`.`ordering`,`u`.`name` AS `author`,`parent`.`title` AS `parent_title`,`parent`.`id` AS `parent_id`,`parent`.`path` AS `parent_route`,`parent`.`alias` AS `parent_alias`,`parent`.`language` AS `parent_language`,ROUND(`v`.`rating_sum` / `v`.`rating_count`, 1) AS `rating`,`v`.`rating_count` AS `rating_count` FROM `joom_content` AS `a` INNER JOIN `joom_categories` AS `c` ON `c`.`id` = `a`.`catid` LEFT JOIN `joom_content_frontpage` AS `fp` ON `fp`.`content_id` = `a`.`id` LEFT JOIN `joom_users` AS `u` ON `u`.`id` = `a`.`created_by` LEFT JOIN `joom_categories` AS `parent` ON `parent`.`id` = `c`.`parent_id` LEFT JOIN `joom_content_rating` AS `v` ON `a`.`id` = `v`.`content_id` WHERE ( (`a`.`id` = :pk AND `c`.`published` > 0) AND (`a`.`publish_up` IS NULL OR `a`.`publish_up` <= :publishUp)) AND (`a`.`publish_down` IS NULL OR `a`.`publish_down` >= :publishDown) AND `a`.`state` IN (:preparedArray1,:preparedArray2)465μs25.38KBParams/components/com_content/src/Model/ArticleModel.php:215Copy
  • SELECT `c`.`id`,`c`.`asset_id`,`c`.`access`,`c`.`alias`,`c`.`checked_out`,`c`.`checked_out_time`,`c`.`created_time`,`c`.`created_user_id`,`c`.`description`,`c`.`extension`,`c`.`hits`,`c`.`language`,`c`.`level`,`c`.`lft`,`c`.`metadata`,`c`.`metadesc`,`c`.`metakey`,`c`.`modified_time`,`c`.`note`,`c`.`params`,`c`.`parent_id`,`c`.`path`,`c`.`published`,`c`.`rgt`,`c`.`title`,`c`.`modified_user_id`,`c`.`version`, CASE WHEN CHAR_LENGTH(`c`.`alias`) != 0 THEN CONCAT_WS(':', `c`.`id`, `c`.`alias`) ELSE `c`.`id` END as `slug` FROM `joom_categories` AS `s` INNER JOIN `joom_categories` AS `c` ON (`s`.`lft` <= `c`.`lft` AND `c`.`lft` < `s`.`rgt`) OR (`c`.`lft` < `s`.`lft` AND `s`.`rgt` < `c`.`rgt`) WHERE (`c`.`extension` = :extension OR `c`.`extension` = 'system') AND `c`.`access` IN (:preparedArray1,:preparedArray2) AND `c`.`published` = 1 AND `s`.`id` = :id ORDER BY `c`.`lft`485μs6.67KBParams/libraries/src/Categories/Categories.php:360Copy
  • SELECT `m`.`tag_id`,`t`.* FROM `joom_contentitem_tag_map` AS `m` INNER JOIN `joom_tags` AS `t` ON `m`.`tag_id` = `t`.`id` WHERE `m`.`type_alias` = :contentType AND `m`.`content_item_id` = :id AND `t`.`published` = 1 AND `t`.`access` IN (:preparedArray1,:preparedArray2)461μs6.25KBParams/libraries/src/Helper/TagsHelper.php:364Copy
  • SELECT `c`.`id`,`c`.`asset_id`,`c`.`access`,`c`.`alias`,`c`.`checked_out`,`c`.`checked_out_time`,`c`.`created_time`,`c`.`created_user_id`,`c`.`description`,`c`.`extension`,`c`.`hits`,`c`.`language`,`c`.`level`,`c`.`lft`,`c`.`metadata`,`c`.`metadesc`,`c`.`metakey`,`c`.`modified_time`,`c`.`note`,`c`.`params`,`c`.`parent_id`,`c`.`path`,`c`.`published`,`c`.`rgt`,`c`.`title`,`c`.`modified_user_id`,`c`.`version`, CASE WHEN CHAR_LENGTH(`c`.`alias`) != 0 THEN CONCAT_WS(':', `c`.`id`, `c`.`alias`) ELSE `c`.`id` END as `slug` FROM `joom_categories` AS `s` INNER JOIN `joom_categories` AS `c` ON (`s`.`lft` <= `c`.`lft` AND `c`.`lft` < `s`.`rgt`) OR (`c`.`lft` < `s`.`lft` AND `s`.`rgt` < `c`.`rgt`) WHERE (`c`.`extension` = :extension OR `c`.`extension` = 'system') AND `c`.`access` IN (:preparedArray1,:preparedArray2) AND `c`.`published` = 1 AND `s`.`id` = :id ORDER BY `c`.`lft`347μs6.67KBParams/libraries/src/Categories/Categories.php:360Copy
  • SELECT DISTINCT a.id, a.title, a.name, a.checked_out, a.checked_out_time, a.note, a.state, a.access, a.created_time, a.created_user_id, a.ordering, a.language, a.fieldparams, a.params, a.type, a.default_value, a.context, a.group_id, a.label, a.description, a.required, a.only_use_in_subform,l.title AS language_title, l.image AS language_image,uc.name AS editor,ag.title AS access_level,ua.name AS author_name,g.title AS group_title, g.access as group_access, g.state AS group_state, g.note as group_note FROM joom_fields AS a LEFT JOIN `joom_languages` AS l ON l.lang_code = a.language LEFT JOIN joom_users AS uc ON uc.id=a.checked_out LEFT JOIN joom_viewlevels AS ag ON ag.id = a.access LEFT JOIN joom_users AS ua ON ua.id = a.created_user_id LEFT JOIN joom_fields_groups AS g ON g.id = a.group_id LEFT JOIN `joom_fields_categories` AS fc ON fc.field_id = a.id WHERE ( (`a`.`context` = :context AND (`fc`.`category_id` IS NULL OR `fc`.`category_id` IN (:preparedArray1,:preparedArray2,:preparedArray3)) AND `a`.`access` IN (:preparedArray4,:preparedArray5)) AND (`a`.`group_id` = 0 OR `g`.`access` IN (:preparedArray6,:preparedArray7)) AND `a`.`state` = :state) AND (`a`.`group_id` = 0 OR `g`.`state` = :gstate) AND `a`.`only_use_in_subform` = :only_use_in_subform ORDER BY a.ordering ASC528μs6.06KBParams/libraries/src/MVC/Model/BaseDatabaseModel.php:165Copy
  • SELECT `contact`.`id` AS `contactid`,`contact`.`alias`,`contact`.`catid`,`contact`.`webpage`,`contact`.`email_to` FROM `joom_contact_details` AS `contact` WHERE `contact`.`published` = 1 AND `contact`.`user_id` = :createdby ORDER BY `contact`.`id` DESC LIMIT 1278μs1.84KBParams/plugins/content/contact/contact.php:147Copy
  • SELECT `a`.`id`,`a`.`title`,`a`.`catid`,`a`.`language`, CASE WHEN CHAR_LENGTH(`a`.`alias`) != 0 THEN CONCAT_WS(':', `a`.`id`, `a`.`alias`) ELSE a.id END AS `slug`, CASE WHEN CHAR_LENGTH(`cc`.`alias`) != 0 THEN CONCAT_WS(':', `cc`.`id`, `cc`.`alias`) ELSE cc.id END AS `catslug` FROM `joom_content` AS `a` LEFT JOIN `joom_categories` AS `cc` ON `cc`.`id` = `a`.`catid` WHERE `a`.`catid` = :catid AND `a`.`state` = :state AND `a`.`access` IN (:preparedArray1,:preparedArray2) AND (`publish_up` IS NULL OR `publish_up` <= :nowDate1) AND (`publish_down` IS NULL OR `publish_down` >= :nowDate2) ORDER BY CASE WHEN `a`.`publish_up` IS NULL THEN `a`.`created` ELSE `a`.`publish_up` END DESC414μs4.41KBParams/plugins/content/pagenavigation/pagenavigation.php:186Copy
  • SELECT `c`.`id`,`c`.`asset_id`,`c`.`access`,`c`.`alias`,`c`.`checked_out`,`c`.`checked_out_time`,`c`.`created_time`,`c`.`created_user_id`,`c`.`description`,`c`.`extension`,`c`.`hits`,`c`.`language`,`c`.`level`,`c`.`lft`,`c`.`metadata`,`c`.`metadesc`,`c`.`metakey`,`c`.`modified_time`,`c`.`note`,`c`.`params`,`c`.`parent_id`,`c`.`path`,`c`.`published`,`c`.`rgt`,`c`.`title`,`c`.`modified_user_id`,`c`.`version`, CASE WHEN CHAR_LENGTH(`c`.`alias`) != 0 THEN CONCAT_WS(':', `c`.`id`, `c`.`alias`) ELSE `c`.`id` END as `slug` FROM `joom_categories` AS `s` INNER JOIN `joom_categories` AS `c` ON (`s`.`lft` <= `c`.`lft` AND `c`.`lft` < `s`.`rgt`) OR (`c`.`lft` < `s`.`lft` AND `s`.`rgt` < `c`.`rgt`) WHERE (`c`.`extension` = :extension OR `c`.`extension` = 'system') AND `c`.`access` IN (:preparedArray1,:preparedArray2) AND `c`.`published` = 1 AND `s`.`id` = :id ORDER BY `c`.`lft`344μs6.67KBParams/libraries/src/Categories/Categories.php:360Copy
  • SELECT `a`.`menutype`,`a`.`title` FROM `joom_menu_types` AS `a` WHERE `a`.`client_id` = 0134μs1.06KB/libraries/gantry5/src/classes/Gantry/Framework/Menu.php:138Copy
  • SELECT m.id, m.alias, m.path AS route, m.level, m.parent_id FROM joom_menu AS m WHERE m.menutype = 'main-menu' AND m.parent_id > 0 AND m.client_id = 0 AND m.published >= 0 ORDER BY m.lft307μs3.17KB/libraries/gantry5/src/classes/Gantry/Framework/Menu.php:791Copy
  • SELECT `m`.`id`,`m`.`title`,`m`.`module`,`m`.`position`,`m`.`content`,`m`.`showtitle`,`m`.`params`,`mm`.`menuid` FROM `joom_modules` AS `m` LEFT JOIN `joom_modules_menu` AS `mm` ON `mm`.`moduleid` = `m`.`id` LEFT JOIN `joom_extensions` AS `e` ON `e`.`element` = `m`.`module` AND `e`.`client_id` = `m`.`client_id` WHERE ( ( (`m`.`published` = 1 AND `e`.`enabled` = 1 AND `m`.`client_id` = :clientId AND `m`.`access` IN (:preparedArray1,:preparedArray2)) AND (`m`.`publish_up` IS NULL OR `m`.`publish_up` <= :publishUp)) AND (`m`.`publish_down` IS NULL OR `m`.`publish_down` >= :publishDown)) AND (`mm`.`menuid` = :itemId OR `mm`.`menuid` <= 0) ORDER BY `m`.`position`,`m`.`ordering`594μs3.53KBParams/libraries/src/Cache/Controller/CallbackController.php:52Copy
  • SELECT `alias` FROM `joom_content` WHERE `id` = :id118μs1.64KBParams/components/com_content/src/Service/Router.php:168Copy
  • SELECT `alias` FROM `joom_content` WHERE `id` = :id99μs1.64KBParams/components/com_content/src/Service/Router.php:168Copy
  • SELECT m.id, m.alias, m.path AS route, m.level, m.parent_id FROM joom_menu AS m WHERE m.menutype = 'my-menu' AND m.parent_id > 0 AND m.client_id = 0 AND m.published >= 0 ORDER BY m.lft212μs1.56KB/libraries/gantry5/src/classes/Gantry/Framework/Menu.php:791Copy
  • SELECT `a`.`id`,`a`.`title`,`a`.`alias`,`a`.`introtext`,`a`.`fulltext`,`a`.`checked_out`,`a`.`checked_out_time`,`a`.`catid`,`a`.`created`,`a`.`created_by`,`a`.`created_by_alias`,`a`.`modified`,`a`.`modified_by`,CASE WHEN `a`.`publish_up` IS NULL THEN `a`.`created` ELSE `a`.`publish_up` END AS `publish_up`,`a`.`publish_down`,`a`.`images`,`a`.`urls`,`a`.`attribs`,`a`.`metadata`,`a`.`metakey`,`a`.`metadesc`,`a`.`access`,`a`.`hits`,`a`.`featured`,`a`.`language`,LENGTH(`a`.`fulltext`) AS `readmore`,`a`.`ordering`,`fp`.`featured_up`,`fp`.`featured_down`,CASE WHEN `c`.`published` = 2 AND `a`.`state` > 0 THEN 2 WHEN `c`.`published` != 1 THEN 0 ELSE `a`.`state` END AS `state`,`c`.`title` AS `category_title`,`c`.`path` AS `category_route`,`c`.`access` AS `category_access`,`c`.`alias` AS `category_alias`,`c`.`language` AS `category_language`,`c`.`published`,`c`.`published` AS `parents_published`,`c`.`lft`,CASE WHEN `a`.`created_by_alias` > ' ' THEN `a`.`created_by_alias` ELSE `ua`.`name` END AS `author`,`ua`.`email` AS `author_email`,`uam`.`name` AS `modified_by_name`,`parent`.`title` AS `parent_title`,`parent`.`id` AS `parent_id`,`parent`.`path` AS `parent_route`,`parent`.`alias` AS `parent_alias`,`parent`.`language` AS `parent_language` FROM `joom_content` AS `a` LEFT JOIN `joom_categories` AS `c` ON `c`.`id` = `a`.`catid` LEFT JOIN `joom_users` AS `ua` ON `ua`.`id` = `a`.`created_by` LEFT JOIN `joom_users` AS `uam` ON `uam`.`id` = `a`.`modified_by` LEFT JOIN `joom_categories` AS `parent` ON `parent`.`id` = `c`.`parent_id` LEFT JOIN `joom_content_frontpage` AS `fp` ON `fp`.`content_id` = `a`.`id` WHERE `c`.`published` = 1 AND `a`.`state` = :condition AND `a`.`catid` IN (:preparedArray1) AND (`a`.`publish_up` IS NULL OR `a`.`publish_up` <= :publishUp) AND (`a`.`publish_down` IS NULL OR `a`.`publish_down` >= :publishDown) ORDER BY RAND() DESC LIMIT 101.72ms144.84KBParams/libraries/src/MVC/Model/BaseDatabaseModel.php:165Copy
  • SELECT `a`.`id`,`a`.`asset_id`,`a`.`title`,`a`.`type`,`a`.`execution_rules`,`a`.`state`,`a`.`last_exit_code`,`a`.`locked`,`a`.`last_execution`,`a`.`next_execution`,`a`.`times_executed`,`a`.`times_failed`,`a`.`priority`,`a`.`ordering`,`a`.`note`,`a`.`checked_out`,`a`.`checked_out_time`,`uc`.`name` AS `editor` FROM `joom_scheduler_tasks` AS `a` LEFT JOIN `joom_users` AS `uc` ON `uc`.`id` = `a`.`checked_out` WHERE `a`.`state` = :state AND `a`.`next_execution` <= :now ORDER BY `a`.`title` asc280μs15.45KBParams/administrator/components/com_scheduler/src/Model/TasksModel.php:391Copy
  • SELECT `a`.`id`,`a`.`asset_id`,`a`.`title`,`a`.`type`,`a`.`execution_rules`,`a`.`state`,`a`.`last_exit_code`,`a`.`locked`,`a`.`last_execution`,`a`.`next_execution`,`a`.`times_executed`,`a`.`times_failed`,`a`.`priority`,`a`.`ordering`,`a`.`note`,`a`.`checked_out`,`a`.`checked_out_time`,`uc`.`name` AS `editor` FROM `joom_scheduler_tasks` AS `a` LEFT JOIN `joom_users` AS `uc` ON `uc`.`id` = `a`.`checked_out` WHERE `a`.`state` = :state AND `a`.`locked` IS NOT NULL ORDER BY `a`.`title` asc281μs4.43KBParams/administrator/components/com_scheduler/src/Model/TasksModel.php:391Copy