Planned small change in EXPLAIN behavior

Planned small change in EXPLAIN behavior

Post by Tom La » Thu, 05 Dec 2002 00:09:11



I am thinking of tweaking EXPLAIN so that it performs ExecutorStart()
and ExecutorEnd() even when you just do plain EXPLAIN (and not EXPLAIN
ANALYZE).  The immediate reason for this is an internal change (details
below) but it would have a couple of user-visible side effects:

1. Permissions checking would occur on the tables referenced in the
query.  Right now it's possible for a user to EXPLAIN a query he would
not be allowed to execute, which seems like a bad idea.  (For example,
a person could infer something about the statistics of a table he
couldn't read, such as column min or max values, by seeing how the
planner optimizes different queries.)

2. Appropriate locks would be acquired on the tables.  This is probably
not an improvement, but I don't think it's unpleasant enough to be worth
worrying about.

Any thoughts or objections?

                        regards, tom lane

(BTW, the REAL reason I want to do this: as part of the read-only-plans
project I would like to get rid of the planner's present activity of
building lists of SubPlans.  They're a pain in the neck to maintain and
aren't useful to the planner itself.  The executor can easily build the
lists as part of the PlanState tree during ExecutorStart, since it'll be
groveling over the whole plan tree anyway.  The *only* place in the
system that needs this info outside the executor is EXPLAIN --- which
does ExecutorStart anyway if it's the EXPLAIN ANALYZE case.  Rather than
writing a bunch of extra code to find the subplans the hard way, I want
to just call ExecutorStart always.)

---------------------------(end of broadcast)---------------------------
TIP 2: you can get off all lists at once with the unregister command

 
 
 

1. Strange behavior anyone can explain!!!

Here is what I am trying to do:
I am creating temp table with 5 cols when I select * from #temp I get
back the first 3col, but if i explicitly choosen all the 5 col. it is
working, why the * is not working??
here is my code

CREATE TABLE #temp (COL1 VARCHAR(50), COL2 VARCHAR(50), COL3
VARCHAR(50), COL4 VARCHAR(50), COL5 VARCHAR(50))
INSERT INTO #temp (COL1, COL2, COL3, COL4, COL5) VALUES('Last Name',
'Message', 'Middle Name', 'First Name', 'Sushi')
INSERT INTO #temp (COL1, COL2, COL3, COL4, COL5) VALUES('test13',
'HELLO1', 'test12', 'test11', 'Yes')
INSERT INTO #temp (COL1, COL2, COL3, COL4, COL5) VALUES('test23',
'HELLO222', 'test22', 'test21', 'No')
SELECT COL1, COL2, COL3, COL4, COL5 FROM #temp
SELECT * FROM #temp

(1 row(s) affected)

(1 row(s) affected)

(1 row(s) affected)

COL1
COL2
COL3
COL4                                               COL5
--------------------------------------------------
--------------------------------------------------
--------------------------------------------------
--------------------------------------------------
--------------------------------------------------
Last Name
Message                                            Middle
Name                                        First
Name                                         Sushi
test13
HELLO1
test12
test11                                             Yes
test23
HELLO222
test22
test21                                             No

(3 row(s) affected)

COL1
COL2                                               COL3
--------------------------------------------------
--------------------------------------------------
--------------------------------------------------
Last Name
Message                                            Middle Name
test13
HELLO1                                             test12
test23
HELLO222                                           test22

(3 row(s) affected)

2. Dealing with large database update/insert

3. can't explain query behavior

4. Where to find Personal oracle 7 or 8

5. Explain this behavior with NULL return value from select inside if boolean_expression

6. What is RSAM time?

7. can some explain this moronic behavior to me???

8. Auto filling a List box from a table

9. Can anyone explain this behavior?

10. small explain patch

11. Odd behavior of BCP with small batches

12. Hang and strange behavior from small table frame

13. Problems during explain plan