Showing entries 1236 to 1245 of 44756
« 10 Newer Entries | 10 Older Entries »
MySQL: Selecting random rows

Given a table named tbl with one million entries, we want to select a random row from this table, fast. Our table definition looks like this:

create table tbl (
    id INTEGER NOT NULL,
    d VARCHAR(200) NOT NULL,
    INDEX(id)
);

Dense id space

We can generate some test data using a recursive CTE:

mysql> set cte_max_recursion_depth = 100000;
mysql> insert into tbl 
    -> with recursive c(n, u) as (
    ->   select 1, uuid() 
    -> union all
    ->   select n+1, uuid() from c where n < 100000
    -> ) select * from c ;

The Recursive CTE will generate 100k pairs of (number, uuid()). The initial row is defined in the upper row of the UNION, each subsequent row builds recursively on top of that, by simply counting …

[Read more]
OpenLampTech issue #66 – Substack Repost

2023 is flying by and so are the weekly OpenLampTech newsletter issues. I cannot thank you enough for reading the weekly newsletter publication. But, I’ll try anyway: thanks so much! Now to this week’s issue…

The Newsletter for PHP and MySQL Developers

Receive a copy of my ebook, “10 MySQL Tips For Everyone”, absolutely free when you subscribe to the OpenLampTech newsletter.

In OpenLampTech issue #66, we have content on:

  • SQL JSON columns
  • Apache mod_rewrite
  • MySQL Document Store
  • WordPress local development cheatsheet
  • And a whole lot more

If you’re not already, be sure and …

[Read more]
ChatGPT Won’t Replace MySQL DBA – An Example of a Question About Encryption at Rest

ChatGPT is the hottest topic in the tech world right now. One story even says that ChatGPT has passed Google’s Level 3 programming interview.  I wondered, does that mean ChatGPT is ready to replace MySQL DBAs, too? No. Let me show you why.

Recently, one of our clients was considering encrypting their data at rest using the Percona file-based keyring plugin. To make the process more secure, they considered removing the local keyring_file after MySQL started. So even if someone gets host access, the data files are still protected because they do not have access to the master key used to encrypt the keys for the tables running Encryption at Rest.

Let ChatGPT try its hand at MySQL administration

Let’s see what ChatGPT will say.

I asked ChatGPT the …

[Read more]
Faster MySQL with HTTP/3

Join PlanetScale’s Lead Infrastructure Engineer for Edge connectivity for an explainer on our findings regarding HTTP/3 and the MySQL protocol.

Deploying a Galera Cluster with Galera Manager on AWS EC2

In the event that you are not planning to deploy Galera Cluster using Galera Manager on your own on-premise hosts, it is worth noting that Galera Manager supports the ability to automatically deploy a 3-node Galera Cluster in Amazon Web Services (AWS) Elastic Compute Cloud (EC2) automatically, just by suppling your API key information. Naturally, we also made a video on a step-by-step video on how to install Galera Cluster in an Amazon EC2 using Galera Manager.

It is worth noting that you can use the free tier to deploy your Galera Cluster with Galera Manager for testing purposes.

Obtain Galera Manager via filling in the form. Logon to your AWS Console. Launch just one EC2 …

[Read more]
Introducing the MySQL REST Service

The MySQL REST Service (MRS) enables fast and secure HTTPS access for your MySQL data.

Deploying MySQL Group Replication With Terraform

Previously, I wrote about our Terraform provider to deploy Percona Server for MySQL (Percona Server for MySQL: Automatic Cloud Deployment With Terraform) and Percona Monitoring and Management (Deploying Percona Monitoring and Management (PMM) With Terraform). Now we also added the capability to deploy Group Replication configuration with Percona Server for MySQL, and assuming we have PMM installed (see previous post), we also can automatically add Group Replication nodes to PMM monitoring.

resource "percona_ps" "psgr" {
  count = 1
  instance_type            = "t3.micro" # for AWS
  key_pair_name            = "sshKey1"
  password                 = "password"
  replication_type         = "group-replication" …
[Read more]
How Bloom Filters Work in MyRocks

Bloom filters are an essential component of an LSM-based database engine like MyRocks. This post will illustrate through a simple example how bloom filters work in MyRocks.

Why?

With MyRocks/RocksDB, data is stored in a set of large SST files.  When MyRocks needs to find the value associated with a given key, it uses a bloom filter to guess if the key could potentially be in an SST file.

How?

A bloom filter is a space-efficient way of storing information about a list of keys. At its base, there is a bitmap and a hash function.  The hash value of the keys stored in an SST is computed, and the results are used to set some bits to “1” in the bitmap.  When you want to know if a key is present or not in the list, you run it through the hash function and check if the corresponding bits in the bitmap are …

[Read more]
Deploying a Galera Cluster with Galera Manager on your own on-premise hosts

Our most favoured method of deploying Galera Clusters via Galera Manager happen to be the on-premise option, which is favoured by our customers and users. We have always been under the impression that the cloud deployments (AWS, DigitalOcean) would have more pull, but majority do prefer an on-premise installation. We have also made an appropriate video: A step-by-step video on how to install Galera Cluster on premises using Galera Manager.

So to start, we will deploy 3 hosts, running CentOS 7. These are just deployed with the base operating system (OS). And of course, you need another host to run your Galera Manager, so in total we have four (4) hosts. Obtain Galera Manager via filling in the form.

Once you have the …

[Read more]
Synopsis of Mydbops 19th edition of MyWebinar

Thank you to everyone who joined us for the 19th edition of MyWebinar. We hope that our time together helped to elevate and seam your work to perfection. We’re committed to giving back to the opensource database community in the coming days by presenting more LIVE events.

Recently, Mydbops conducted a webinar on the top 10 features of MySQL 8. MySQL is one of the most popular and widely used open-source relational database management systems. With every new version, MySQL brings new features and enhancements that make it more reliable, secure, and efficient. In this blog, we will wrap up the top 10 features of MySQL 8 discussed in the webinar by Mydbops.

Vinoth Kanna, co-Founder from  …

[Read more]
Showing entries 1236 to 1245 of 44756
« 10 Newer Entries | 10 Older Entries »