This is installment number four in my series on Oracle Exadata Storage Server and HP Oracle Database Machine frequently asked questions. I recommend you also visit:
Oracle Exadata Storage Server Frequently Asked Questions Part I.
Oracle Exadata Storage Server Frequently Asked Questions Part II.
Oracle Exadata Storage Server. Frequently Asked Questions. Part III.
I’m mostly cutting and pasting questions from the comment threads of my blog posts about Exadata and mixing in some assertions I’ve seen on the web and re-phrasing them as questions. If they read as questions when I see then I cut and paste them without modification.
Q. What is meant in the Exadata white paper about Smart Scan Predicate Filtering by “…only rows where the employees hire date is after the specified date are sent from Exadata to the database instance..”? Does it really only return the rows matching the predicate or does it return all blocks containing rows which match the predicate? If the former is correct, how is this handled in the db block buffer?
A. Actually, that statement is a bit too liberal. Oracle Exadata Storage Server Smart Scans return only the cited columns from only the filtered rows, not entire rows as that statement may suggest. Results from a Smart Scan are not “real” database blocks thus the results do not get cached in the SGA. Consider the following business question:
List our Club Card members that have spent more than $1,000.00 at non-partner retail merchants in the last 180 days with our affinity credit card. Consider only non-partner merchants within 10 miles radius of one of our stores.
The SQL statement in the following text box answers this question (assuming 10-mile wide US postal code zones):
select cf.custid, sum(act.purchase_amt) salesfrom all_card_trans act, cust_fact cf where ( act.card_no like '4777%' or act.card_no like '3333%' ) and act.card_no = cf.aff_cc_num and cf.club_card_num not like '0%' and act.purchase_dt > to_date('07-MAR-2008','dd-mon-yyyy')
and act.merchant_zip in ( select distinct(zip) from our_stores) and act.merchant_code not in (select merchant_code from partner_merchants) group by custid having sum(act.purchase_amt) > 1000 ; |
Intelligent Storage. Filtering and Projecting. Oh, and a Bloom Filter Too.
Now, let’s look at the predicate handling in the plan. The next text box shows that storage is filtering based on club cards, purchase dates and credit card. Given the way this query functions, all_card_trans is essentially like a fact table and cust_fact is more of a dimension table since there are 1,300 fold more rows in all_card_trans than cust_fact. You’ll also see there was a bloom filter pushed to the Exadata Storage Server cells used to join the filtered cust_fact rows to the filtered all_card_trans rows.
Predicate Information (identified by operation id):--------------------------------------------------- 3 - filter(SUM("ACT"."PURCHASE_AMT")>1000)
7 - access("ACT"."MERCHANT_CODE"="MERCHANT_CODE")
10 - access("ACT"."MERCHANT_ZIP"="ZIP")
15 - access("ACT"."CARD_NO"="CF"."AFF_CC_NUM")
20 - storage("CF"."CLUB_CARD_NUM" NOT LIKE '0%')
filter("CF"."CLUB_CARD_NUM" NOT LIKE '0%')
25 - storage("ACT"."PURCHASE_DT">TO_DATE(' 2008-03-07 00:00:00', 'syyyy-mm-dd hh24:mi:ss') AND ("ACT"."CARD_NO" LIKE '4777%' OR
"ACT"."CARD_NO" LIKE '3333%')) filter("ACT"."PURCHASE_DT">TO_DATE(' 2008-03-07 00:00:00', 'syyyy-mm-dd hh24:mi:ss') AND ("ACT"."CARD_NO" LIKE '4777%' OR
"ACT"."CARD_NO" LIKE '3333%') AND SYS_OP_BLOOM_FILTER(:BF0000,"ACT"."CARD_NO")) |
This example should make the answer a bit clearer. Storage is ripping through the rows, yes, but only returning named columns and heavily filtered data.
The following text box shows frozen output of a tool we used to monitor I/O at a high level across cells. The names of the Exadata Storage cells in this case are called sgbeta1s01-sgbeta1s06 (I’m like you, I have to scrounge for hardware). These are 2 3-second averages showing I/O in excess of 1,000,000 KB per cell or an aggregate of 6 GB/s (see the data under the “bi” column). This is, of course, what we’ve been referring to as a “half-rack” in spite of the fact that it only has 6 Exadata Storage Server cells instead of the 7 that would be a true half-rack. Nonetheless, this is a 4-table query doing real work and, as you can see in the last text box, I’m connected to a single instance of RAC-on a dual socket/quad-core server! Without Exadata, a server would have to have 15 fibre channel host bus adaptors to drive this query at this I/O rate and a great deal of CPU power. That would be a very large server-and it would still be slower.
Kids, don’t try this at home without supervision
procs -----------memory---------- ---swap-- -----io---- --system-- -----cpu------15:29:43: r b swpd free buff cache si so bi bo in cs us sy id wa st sgbeta1s01: 4 0 204 63292 134928 1523732 0 0 1033237 24 5062 37992 25 3 72 0 0 sgbeta1s02: 8 0 204 65708 141800 1596124 0 0 1038949 9 5238 37869 25 3 72 0 0 sgbeta1s03: 4 0 208 1183780 57832 584988 0 0 1049712 35 5862 40258 26 3 69 2 0 sgbeta1s04: 2 0 204 1254456 79084 568052 0 0 1053093 13 5329 38462 25 3 72 0 0 sgbeta1s05: 4 0 0 144924 122252 1453324 0 0 1022032 29 4991 38164 25 3 72 0 0 sgbeta1s06:11 0 0 95808 124200 1418236 0 0 1000635 24 4767 38249 25 2 73 0 0 Minimum: 2 0 0 63292 57832 568052 0 0 1000635 9 4767 37869 25 2 69 0 0 Maximum:11 0 208 1254456 141800 1596124 0 0 1053093 35 5862 40258 26 3 73 2 0 Average: 5 0 136 467994 110016 1190742 0 0 1032943 22 5208 38499 25 2 71 0 0 procs -----------memory---------- ---swap-- -----io---- --system-- -----cpu------ 15:29:46: r b swpd free buff cache si so bi bo in cs us sy id wa st sgbeta1s01: 3 0 204 63012 134928 1523732 0 0 1005643 24 5099 38475 25 2 72 0 0 sgbeta1s02: 2 0 204 65188 141800 1596124 0 0 1011285 3 4867 37671 25 2 73 0 0 sgbeta1s03: 4 0 208 1184408 57832 584988 0 0 1005371 20 5775 39378 25 3 72 0 0 sgbeta1s04: 3 0 204 1255200 79084 568052 0 0 993264 13 4891 38240 24 3 73 0 0 sgbeta1s05: 5 0 0 144320 122256 1453324 0 0 1016859 29 4947 38073 25 3 72 0 0 sgbeta1s06: 6 0 0 95824 124200 1418236 0 0 1019323 24 4961 38224 25 2 73 0 0 Minimum: 2 0 0 63012 57832 568052 0 0 993264 3 4867 37671 24 2 72 0 0 Maximum: 6 0 208 1255200 141800 1596124 0 0 1019323 29 5775 39378 25 3 73 0 0 Average: 3 0 136 467992 110016 1190742 0 0 1008624 18 5090 38343 24 2 72 0 0 |
[oracle@sgbeta1c01]$ sqlpus ‘/ as sysdba'SQL*Plus: Release 11.1.0.7.0 - Production on Thu Oct 2 15:35:55 2008 Copyright (c) 1982, 2008, Oracle. All rights reserved. Connected to: Oracle Database 11g Enterprise Edition Release 11.1.0.7.0 - 64bit Production With the Partitioning, Real Application Clusters, OLAP, Data Mining and Real Application Testing options SQL> select instance_name from gv$instance ; INSTANCE_NAME ---------------- test1 SQL> |




Recent Comments