Re: [Maria-discuss] View missing from EXPLAIN after ORDER BY removed from definition

2015-06-22 Thread Sergey Petrunia
On Mon, Jun 22, 2015 at 01:33:20PM +, Rhys Campbell wrote: > Ah. That makes a lot of sense, but... > > > Ot.col2 doesn't refer to the PK of the underlying table but it is at the head > of a unique index (multiple columns) > So, the outer query is: t1 p LEFT OUTER JOIN t2 ot

Re: [Maria-discuss] View missing from EXPLAIN after ORDER BY removed from definition

2015-06-22 Thread Justin Swanhart
Background: There are two view algorithms, temptable and merge. Merge merges view def with primary SELECT, which is fast. Temptable is same as subquery in from clause and is materialized befor join or filter from primary SELECT is applied. If query needs a temp table, like for order by, tempta

Re: [Maria-discuss] View missing from EXPLAIN after ORDER BY removed from definition

2015-06-22 Thread Justin Swanhart
This is now a merge view because you removed order by. Sent from my iPhone > On Jun 22, 2015, at 4:24 AM, Rhys Campbell > wrote: > > Hello All, > > I had an interesting problem presented to me this morning. A seemingly simple > query was running for ages and filling up /tmp causing MariaDB

Re: [Maria-discuss] View missing from EXPLAIN after ORDER BY removed from definition

2015-06-22 Thread Rhys Campbell
s Campbell Cc: maria-discuss@lists.launchpad.net Subject: Re: [Maria-discuss] View missing from EXPLAIN after ORDER BY removed from definition On Mon, Jun 22, 2015 at 11:24:39AM +, Rhys Campbell wrote: > Hello All, > > I had an interesting problem presented to me this morning.

Re: [Maria-discuss] View missing from EXPLAIN after ORDER BY removed from definition

2015-06-22 Thread Sergey Petrunia
On Mon, Jun 22, 2015 at 11:24:39AM +, Rhys Campbell wrote: > Hello All, > > I had an interesting problem presented to me this morning. A seemingly simple > query was running for ages and filling up /tmp causing MariaDB to crash. Now, > this isn't perhaps the best designed database but the qu

[Maria-discuss] View missing from EXPLAIN after ORDER BY removed from definition

2015-06-22 Thread Rhys Campbell
Hello All, I had an interesting problem presented to me this morning. A seemingly simple query was running for ages and filling up /tmp causing MariaDB to crash. Now, this isn't perhaps the best designed database but the query didn't seem to be that bad. T1 is a table but t2 is a view (modified