Showing entries 901 to 910 of 22229
« 10 Newer Entries | 10 Older Entries »
Displaying posts with tag: MySQL (reset)
Economical Comparison of AWS CPUs for MySQL (ARM vs Intel vs AMD)

It is always hard to select a CPU for your own purpose. You could waste hours reviewing different benchmarks, reviews, and bloggers, and in the end, we would limit all our requirements to performance and price. For performance measuring we already have some specific metrics (e.g. in MHz to some specific tool), however, for economic comparison, it is quite hard.  Mostly we are limited by our budget. Again, for our personal purposes, we are limited only with the cash in our pockets. It is easy to compare only two or three CPUs; it is required just to compare their price and performance and then create a simple bar plot and then check the results. However, what do you do if you have at least three types of CPU, a different number of CPUs cores on board, and seven different scenarios?  It was a challenge to do it for performance, and for economic efficiency, it has become a nightmare. For a one-time purchase, it should be easier than for the …

[Read more]
Counting with countAll() and countAllResults() in CodeIgniter 4

Getting a count of table or query rows in CodeIgniter 4 is quite easy using either of the Query Builder countAll() or countAllResults() functions. Continue reading to see examples of each…

Do you need to learn MySQL? Just starting and confused about how to query a table and get the data you need? I am creating premium MySQL Beginners content for this specific reason. To help those who want to learn the basics of MySQL but don’t know where to start. Learn more about the premium blog posts as I develop and release them.

Tell me more!

Image by  …

[Read more]
Apache Zeppelin on Oracle Cloud with MySQL HeatWave

On the previous article we saw how to easily deploy Apache Zeppelin on OCI with MySQL using Terraform.

In this article we will see how we can accelerate queries enabling MySQL HeatWave.

Enabling HeatWave

If you used a MySQL Database Service Shape compatible with HeatWave (MySQL.HeatWave.VM.Standard.E3), using the same Resource Manager Stack, you have the possibility to enable HeatWave and deploy a HeatWave Cluster for your MySQL.

The first think to do, is to edit the previous applied stack:

As we used a HeatWave compatible shape, we have the choice to deploy a HeatWave Cluster and we can choose it:

Save and Apply… the HeatWave cluster will be added:

If you …

[Read more]
Diskspace Problem When Modifying a Large InnoDB Table in MySQL… and how to solve it !

Recently, somebody requested some help as he was trying to modify the structure of a large table. The requested modification was related in changing a fixed length string to a variable length string column.

If you don’t know it yet, MySQL supports multiple algorithms when altering a table (DDL):

  • COPY: operations are performed on a copy
  • INPLACE: operations may rebuild the table inplace (no copy)
  • INSTANT: operations only change the metadata in the data dictionnary

The operation that interests us today needs to copy the full table. And this was the problem for the user as the MySQL Datadir could not store twice the amount of that large table.

In this blog post I will explain a method that can be used to solve this problem. There are also others method like a logical dump …

[Read more]
OpenLampTech issue #13

This week’s issue of OpenLampTech, the newsletter for PHP/MySQL developers is once again loaded to the brim with the best content I can curate for your reading pleasure. I absolutely enjoy running and sharing the newsletter and I hope you are enjoying the content just as much. Thank you!!!!

Do you need to learn MySQL? Just starting and confused about how to query a table and get the data you need? I am creating premium MySQL Beginners content for this specific reason. To help those who want to learn the basics of MySQL but don’t know where to start. Learn more about the premium blog posts as I develop and release them.

Tell me more!

Image by  …

[Read more]
Apache Zeppelin on OCI with MDS

Apache Zeppelin is a web-based notebook that enables data-driven,
 interactive data analytics, machine learning, and collaborative documents with SQL, Scala, Python, R.

Today we will see how we can deploy Apache Zeppelin on a Compute instance in Oracle Cloud Infrastructure (OCI) using MySQL Database Service (MDS).

You can manually deploy a compute instance and install zeppelin on it then connect to MySQL Database Service or you can use the Terraform modules I’m sharing on GitHub: https://github.com/lefred/oci-zeppelin-mds

Finally you can also deploy all this by just clicking on the follow button to use …

[Read more]
Dynamic Drop Table

I always get interesting feedback on some posts. On my test case for discovering the STR_TO_DATE function’s behavior, the comment was tragically valid. I failed to cleanup after my test case. That was correct, and I should have dropped param table and the two procedures.

While appending the drop statements is the easiest, I thought it was an opportunity to have a bit of fun and write another procedure that will cleanup test case tables within the test_month_name procedure. Here’s sample dynamic drop_table procedure that you can use in other MySQL stored procedures:

CREATE PROCEDURE drop_table
( table_name  VARCHAR(64))
BEGIN
 
  /* Declare a local variable for the SQL statement. */
  DECLARE stmt VARCHAR(1024);
 
  /* Set a session variable with two parameter markers. */
  SET @SQL := CONCAT('DROP TABLE ',table_name);
 
  /* Check if the …
[Read more]
Incremental Backup in MySQL Using Page Tracking

Incremental backups of MySQL, specifically for the InnoDB engine, are taken by copying modified pages from the previous backup.

The brute force method takes backups by scanning every page in tablespace file in the server data directory is an expensive operation. The time required for incremental backups increases as the data-dir size increases.

To solve this problem, Percona Server for MySQL introduced a  “Changed Page Tracking” feature in 5.6 that enables Percona XtraBackup (PXB) to copy only the modified pages required for incremental backups. See the Percona XtraBackup Documentation for more information. …

[Read more]
str_to_date Function

As many know, I’ve adopted Learning SQL by Alan Beaulieu as a core reference for my database class. Chapter 7 in the book focuses on data generation, manipulation, and conversion.

The last exercise question in my check of whether they read the chapter and played with some of the discussed functions is:

  1. Use one or more temporal function to write a query that convert the ’29-FEB-2024′ string value into a default MySQL date format. The result should display:
    +--------------------+
    | mysql_default_date |
    +--------------------+
    | 2024-02-29         |
    +--------------------+
    1 row in set, 1 warning (0.00 sec)
    

If you’re not familiar with the behavior of MySQL functions, this could look like a difficult problem to solve. If you’re risk inclined you would probably try the STR_TO_DATE function but if you’re not risk inclined the description of the %m specifier might suggest you …

[Read more]
Case Sensitive Comparison

Sometimes you hear from some new developers that MySQL only makes case insensitive string comparisons. One of my students showed me their test case that they felt proved it:

SELECT STRCMP('a','A') WHERE 'a' = 'A';

Naturally, it returns 0, which means:

  • The values compared by the STRCMP() function makes a case insensitive comparison, and
  • The WHERE clause also compares strings case insensitively.

As a teacher, you’re gratified that the student took the time to build their own use cases. However, in this case I had to explain that while he was right about the STRCMP() function and the case insensitive comparison the student used in the WHERE clause was a choice, it wasn’t the only option. The student was wrong to conclude that MySQL couldn’t make case sensitive string comparisons.

I modified his sample by adding the required BINARY keyword for a case sensitive comparison in …

[Read more]
Showing entries 901 to 910 of 22229
« 10 Newer Entries | 10 Older Entries »