Skip to content

Mastering PHP and Laravel

Never stop learning!

Menu

  • Home
  • Blog Posts

SQL

SQL EXPLAIN: The “filtered” column

The filtered column shows an estimated percentage of rows that will be filtered by the table WHERE clause. It’s typically only shown during the EXPLAIN EXTENDED command.

Kenny September 25, 2018January 21, 2023 Blog Posts, Learning, Programming, SQL No Comments Read more

SQL EXPLAIN: The “ref” column

The “ref” column shows which columns or constants are compared to the index named in the “key” column to select rows from the table. This comes right from the manual, but I have noticed that when the value is const,

Kenny September 25, 2018January 21, 2023 Blog Posts, Learning, Programming, SQL No Comments Read more

SQL EXPLAIN: Index-related columns

These relate to the usage of indexes:  possible_keys Which indexes were considered? key Which indexes did the optimizer choose?  key_len How many bytes of the index will be used?

Kenny September 25, 2018January 21, 2023 Blog Posts, Learning, Programming, SQL No Comments Read more

SQL EXPLAIN: The “type” column

The “type” column indicates how MySQL will access rows From worse to better: ALL index range ref eq_ref const system NULL

Kenny September 25, 2018January 21, 2023 Blog Posts, Learning, Programming, SQL No Comments Read more

A faster alternative to correlated sub-queries

I recently had to rewrite a query that was running very slowly. It was taking over 30 seconds. Upon analyzing it, I saw that it had 2 correlated sub-queries in it, and each was doing a count(*). This meant that

Kenny September 19, 2018January 21, 2023 Blog Posts, Learning, Programming, SQL No Comments Read more

SQL sub query challenge

Goal: Write a query which will get the first and last name from the customer table, and the total amount of all that customer’s orders. SELECT first,last FROM customers C This will get all the customers.Next we need to write

Kenny July 15, 2018January 21, 2023 Blog Posts, Learning, Programming, SQL No Comments Read more

ACID

A.C.I.D. Atomicity Consistency Isolation Durability Atomicity in a database system means that a sequence of events within a transaction must all occur or nothing occurs. Because of this, the transaction cannot be observed by an outside process as “in progress”.

Kenny May 18, 2018January 21, 2023 Blog Posts, Learning, SQL No Comments Read more

Archives

Categories

  • Blog Posts (90)
  • iPhone (2)
  • Learning (42)
  • Linux (4)
    • Debian (1)
  • Mac Terminal / Linux (6)
  • Other Stuff (1)
  • Programming (68)
    • .NET (1)
      • C# (1)
    • Java (1)
    • Javascript (6)
      • AngularJS (1)
      • Node.js (2)
    • MySQL (3)
    • Objective C (1)
    • PHP (45)
      • Community (5)
      • Laravel (9)
        • Eloquent (3)
    • SQL (7)
    • Tools (2)
      • PHP Storm (1)
  • Slim Framework (1)
  • Uncategorized (9)
  • WordPress (3)
Copyright © 2023 Mastering PHP and Laravel. All rights reserved. Theme Spacious by ThemeGrill. Powered by: WordPress.