Simple query using group clause for 1 million records resulting
in final list of 27 records.
First time takes 0.43053775 secs.
Same query through Stored procedure: First time takes 0.43341600
secs.
So in terms of time, first time they are very close.
Profiling comparison for both can be seen in below figure
no_cache_comparison.png where left one is simple inline query and
right one is stored procedure query.
There are some actions which are extra in the inline query:
1. freeing items
2. logging slow query
3. cleaning up
Running both second time retrieve data from cache …
My test environment is:
Ubuntu 14.04 Trusty Tahr
MySQL Server version: 5.5.44-0ubuntu0.14.04.1 (Ubuntu)
MySQL uses sql cache to store results of queries that have been
executed so that when the same query is executed again it
retrieves the result data set from the cache instead of getting
it again from db. So it is faster data access.
It is by default enabled in MySQL.
This is interesting since there is one question we ought to ask
here whether we should use it or disable it or just leave it as
it is who cares :).
Ok, moving forward today's session goals are:
- How useful is MySQL cache?
- When to use it and when not to use it?
- What to do if you do not want to use it?
There are some catchy areas here too like not all your queries
will be stored in cache. …
In my latest series of advanced replication features, I came across several usability
issues, which I would like to recap here. For each section of
this list of requests, I make a wish list, with some general
comments.
INSTALLATIONAs the maintainer of MySQL Sandbox, a
tool that wants to facilitate the installation of …
The following presentation was given at the Oracle Technology Network (OTN) Latin America 2015 tour events in Uruguay, Argentina, Chile and Peru.
In this presentation I talk about the various versions and means of installing and upgrading MySQL including:
- MySQL version history from 3.23 to 5.7.8
- Historical installation options
- Recommended use of Oracle yum repository for current version
- The installation and upgrade process, and errors that occur
- Compatibility changes between MySQL 5.5 and MySQL 5.6
including
- Reserved words (and their true impact)
- Legacy TIMESTAMP usage …
For those of you who would like a copy of the slides from my webinar, they are now online at slideshare . Thanks again if you attended!
I wasn’t able to answer all the questions that were submitted at the end, so I’m collecting those, and more from your emails, for the next post: Q&A.
Hi, I'm Ben Osheroff, an engineer on the infrastructure team at Zendesk. My team began this year with a single goal: to better scale Zendesk's view system.
If you haven't tried Zendesk yet, views are lists of tickets with user-specified constraints, generally consumed by support agents as a workflow tool. As implemented, views are a SQL generation and execution engine, and this poses some interesting scale challenges: giving your customers a fully-featured bridge to SQL means that they will find all sorts of creative ways to generate queries your databases aren't prepared to handle.
To solve this, we've beenbuilding a system based on adaptive caches, where Zendesk keeps "materialized views" of expensive-to-execute queries, created on the fly as needed. At the heart of this caching system is a data firehose, a change capture system like …
[Read more]If you attended my webinar, MySQL for Oracle DBAs, thank you! I hope you enjoyed it.
We ran out of time while I was answering questions for Q&A, so I apologize if I didn’t answer your question. Please email any questions to me at ben-dot-krug-at-oracle-dot-com. Also, if you were asking for a copy of the slides (or would like to ask), also email me – I’ll be happy to send them!
Thanks again!
State Snapshot Transfer (SST) at a glance
PXC uses a protocol called State Snapshot Transfer to provision a node joining an existing cluster with all the data it needs to synchronize. This is analogous to cloning a slave in asynchronous replication: you take a full backup of one node and copy it to the new one, while tracking the replication position of the backup.
PXC automates this process using scriptable SST methods. The most common of these methods is the xtrabackup-v2 method which is the default in PXC 5.6. Xtrabackup generally is more favored over other SST methods because it is non-blocking on the Donor node (the node contributing the backup).
The basic flow of this method is:
- The Joiner:
- joins the cluster …
[…] (i.e. a MYSQL database is akin to an Oracle schema), I found Patrick Hurley’s introduction to MySQL for Oracle DBAs helpful when approaching these […]
I’m the kind of DBA that prefers to keep everything simple, BUT,
sometimes it’s not possible. Few days ago I’ve faced an issue
where none of the collations shipped by default with MySQL would
guarantee integrity of my database, and to avoid a massive
re-write of application code, we have explored an option that up
to the day, I didn’t know about.
Add your own collation to MySQL.
This option is described on this section of MySQL documentation . On this post I will show how to make MySQL identify volves with acute accent (fada) as a different letter:
First, let’s find out where is our character-set folder:
mysql [localhost] {msandbox} ((none)) > SHOW VARIABLES LIKE
'character_sets_dir';
+--------------------+---------------------------------------+
| Variable_name | Value |
…