xtuple/xtuple — pull request #1439 by bendiy (2014-05-01 20:46:59+00:00)
Title: Taxperformance

When looking into performance on #23537, I was testing calculatetaxdetailsummary() and found this change helps the query planner not query all inherited tables.

Most of this is removing spaces at the end of lines. Relevant parts are these changes:

```sql
- FROM taxhist
+ FROM ' || _table || '
JOIN tax ON (taxhist_tax_id=tax_id)
- JOIN pg_class ON (pg_class.oid=taxhist.tableoid)
- WHERE ( (taxhist_parent_id = ' || pOrderId || ')
- AND (taxhist_taxtype_id=getadjustmenttaxtypeid())
- AND (relname=''' || _table || ''') )';
+ WHERE ( (taxhist_parent_id = ' || pOrderId || ')
+ AND (taxhist_taxtype_id=getadjustmenttaxtypeid()) )';
```

Why query taxhist and pg_class when we already know the child table name?