![]() | |
![]() |
| | Thread Tools | Display Modes |
#1
| |||
| |||
|
#2
| |||
| |||
|
|
I think I have a new instance of the "Variable not Found in Subplan Target List" bug, or at least one that was not patched in 7.4.1. |
#3
| |||
| |||
|
|
CREATE VIEW "sv_cases" as SELECT cases.case_id, cases.case_name, cases.docket, status.status_label, cases.opp_counsel_name, trial_groups.tgroup_name, cases.tgroup_id, cases.status, cases.lead_case_docket, cases.lead_case_id, cases.priority, tpr.rollup1 as pr_element, tpr.rollup2 as pr_label FROM status, ( SELECT vchar_to_int2(list_value) as priority, rollup1, rollup2 from text_list_values WHERE list_name = 'Case Priority' ) tpr, cases LEFT JOIN trial_groups on cases.tgroup_id = trial_groups.tgroup_id WHERE (cases.status = status.status AND status.relation = 'cases'::"varchar") AND cases.priority = tpr.priority; |
#4
| |||
| |||
|
|
Hmmm ... problem is, per my last e-mail, the bug is not reproducable off of this particular database instance -- if I copy it to my laptop, the bug goes away. |
#5
| |||
| |||
|
|
There are several (two or three, I forget) post-7.4.1 fixes that resolve bugs that all have that symptom. I can't tell with this much info whether you have a new case or one of the known ones. I'd suggest pulling the tip of REL7_4_STABLE branch to see if it's fixed. |
#6
| |||
| |||
|
|
RELOADING the view fixed the error. |
|
Here's the EXPLAIN plan: |
#7
| |||
| |||
|
|
It's presumably dependent on the contents of pg_statistic and the relpages/reltuples counts in pg_class for the tables involved. You could likely reproduce it by migrating that data to your laptop. It would take a little bit of hacking to get the pg_statistic data in (adjusting starelid for instance) but I think it's doable. Note that the planner control settings (eg effective_cache_size) might also need to be copied. |
#8
| |||
| |||
|
|
Hmmm ... could I do it through a binary file copy? I'm on a bit of a deadline here, and need to replace the bad view in the next hour or so. |
#9
| |||
| |||
|
|
RELOADING the view fixed the error. What do you mean by "reloading the view", exactly? |
|
The cost numbers here are very small; are the tables themselves small, or did you reload them too? |
#10
| |||
| |||
|
|
What do you mean by "reloading the view", exactly? I created the same view under a new name. The new view runs fine. |
![]() |
| Thread Tools | |
| Display Modes | |
| |