Similar Threads:
1.Explain SQL strange syntax, please
In revising some of my old MySQL scripts, existing syntax works, but
I've no reason why (or where I got it from to begin with).
Ex. Using MySQL in PHP to INSERT a row, the VALUES segment lists some
values like this:
$setsqlcall = "INSERT INTO a_table (
a_name,
a_time )
VALUES (
'".$aname."',
'".$atime."')";
Most examples show simply '$aname' and '$atime'. Why the '".$var."'
syntax - extra pairings of 'double-quote & period ... period &
double-quote' inside paired single-quotes.
In searching for answers I have seen '"+$var+"' too.
Could sometime explain this for me. (Also, if you know where
explanation are to be found for this, I'd like to know that too.)
Thanks, RG
2.experimenting with coalesce, strange EXPLAIN results
I was experimenting with moving some of my case logic out of the
application and into sql and found a strange EXPLAIN result with one of
my COALESCE statements. Why is each subselect listed twice? This is in
7.3.4 on freebsd 4.8.
cms3=# explain analyze select coalesce ((sELECT thumb FROM content_group_descriptor WHERE content_group_id = 140 AND language_id = 1),(SELECT tc.file FROM thumbnail_content tc, ccl WHERE tc.parent_content_id = cid AND ccgid = 140 limit 1));
QUERY PLAN
--------------------------------------------------------------------------------------------------------------------------------------------------------
Result (cost=0.00..0.01 rows=1 width=0) (actual time=0.98..0.98 rows=1 loops=1)
InitPlan
-> Seq Scan on content_group_descriptor (cost=0.00..2.78 rows=1 width=4) (actual time=0.10..0.10 rows=0 loops=1)
Filter: ((content_group_id = 140) AND (language_id = 1))
-> Seq Scan on content_group_descriptor (cost=0.00..2.78 rows=1 width=4) (never executed)
Filter: ((content_group_id = 140) AND (language_id = 1))
-> Limit (cost=0.00..8.43 rows=1 width=12) (actual time=0.35..0.42 rows=1 loops=1)
-> Nested Loop (cost=0.00..14.94 rows=2 width=12) (actual time=0.34..0.40 rows=2 loops=1)
-> Seq Scan on content_collection (cost=0.00..5.46 rows=1 width=4) (actual time=0.24..0.26 rows=3 loops=1)
Filter: (content_collection_group_id = 140)
-> Index Scan using parent_file_key on thumbnail_content tc (cost=0.00..6.83 rows=1 width=8) (actual time=0.02..0.02 rows=1 loops=3)
Index Cond: (tc.parent_content_id = "outer".content_id)
-> Limit (cost=0.00..8.43 rows=1 width=12) (actual time=0.32..0.39 rows=1 loops=1)
-> Nested Loop (cost=0.00..14.94 rows=2 width=12) (actual time=0.31..0.37 rows=2 loops=1)
-> Seq Scan on content_collection (cost=0.00..5.46 rows=1 width=4) (actual time=0.24..0.26 rows=3 loops=1)
Filter: (content_collection_group_id = 140)
-> Index Scan using parent_file_key on thumbnail_content tc (cost=0.00..6.83 rows=1 width=8) (actual time=0.01..0.02 rows=1 loops=3)
Index Cond: (tc.parent_content_id = "outer".content_id)
Total runtime: 1.14 msec
(19 rows)
---------------------------(end of broadcast)---------------------------
TIP 1: subscribe and unsubscribe commands go to XXXX@XXXXX.COM
3.Looking for help building 'rhdb-explain' Visual Explain tool
I'm hoping there's someone here with experience in building the Visual
Explain tool from Red Hat. I downloaded it and the J2 SDK, but when I
attempt to follow the build instructions, I get messages like:
error: Type `JTableHeader' not found in the declaration of the local
variable `header'.
[javac] JTableHeader header = null;
To me, this indicates that the SDK isn't installed (properly). But I
admit I'm pretty much a Java know-nothin'.
4.Looking for help building 'rhdb-explain' Visual Explain
Jeff Boes wrote:
> I'm hoping there's someone here with experience in building the Visual
> Explain tool from Red Hat. I downloaded it and the J2 SDK, but when I
> attempt to follow the build instructions, I get messages like:
>
> error: Type `JTableHeader' not found in the declaration of the local
> variable `header'.
> [javac] JTableHeader header = null;
>
> To me, this indicates that the SDK isn't installed (properly). But I
> admit I'm pretty much a Java know-nothin'.
>
Jeff, have tou set the environment variable JAVA_HOME to where your SDK
is installed?
Please try:
echo $JAVA_HOME
and
which javac
Regards,
Fernando
---------------------------(end of broadcast)---------------------------
TIP 3: if posting/reading through Usenet, please send an appropriate
subscribe-nomail command to XXXX@XXXXX.COM so that your
message can get through to the mailing list cleanly
5.Explain plan for SQL stored procedure
Hi,
I want to get a full EXPLAIN plan of my SQL stored procedure. I found out
that you can set environmental variables by using db2set. So I added the
line:
DB2_SQLROUTINE_PREPOPTS=EXPLAIN ALL
But when I use db2expln like:
db2expln -d <db> -u <username> <password> -o c:\explain.txt -c <creator> -p
<package_id> -s 0
I see all different sections but without a plan (same as before I changed
the db2set option). For most sections a line is written stating "Section
will be recompiled at next use.".
What I then did was executing a CALL statement on this SQL stored procedure
with not effect. I also tried to REBIND the package.
I also performed a db2stop and db2start so that maybe the
DB2_SQLROUTINE_PREPOPTS was initialized, also this had no effect.
I wonder whether the sections in my SQL stored procedures get precompiled
everytime or that I have to perform some more actions to get a well-formed
explain plan.
Thanks for any help,
Onno Ceelen
6. SQL explain plan
7. EXPLAIN SQL against DGTTs
8. Getting SQL0901N error with SQL State: 58004 on running explain plans