← Back to team overview

oqgraph-dev team mailing list archive

Re: Two main problems remain. Re: Varchar sort of works ...

 

Hi Andrew

> got it working for breadth_first as '2' and djikstra as '1', by
> storing the
> original string into the graph before calling search and then putting
> it into
> the row_info. Its ugly but it works. Later this can all probably be
> refactored to be cleaner.
> 
> (1) However, it causes an assertion outside of ha_graph when you try
> and use '0' for 'no_search' (see after)

Dunno.


> (2) If you use latch = 2 instead of latch = '2' the only function I
> see it call is fill_record(), it seems to skip the index checker and
> search() in that case; and call fill_record() for as many rows in the
> backing graph.

Ah, I think I know why that is.
If you specify a numeric constant to a field that's a varchar, then the server will autocast.
When casting, indexing can't be used, so the optimiser will never look at the index.

This is rather nasty as it means that people using the old numerics have to adjust their code anyway.
In that case, it might be best to catch any numeric input into latch and chuck a specific error that people need to upgrade their code as well as their schema?

Or back to the ENUM idea, but I'm still not really a fan of that... people will have to keep upgrading their schema then.
Mixing structure and data is annoying.


Regards,
Arjen.
-- 
Arjen Lentz, Exec.Director @ Open Query (http://openquery.com)
Australian peace of mind for your MySQL/MariaDB infrastructure.

Follow us at http://openquery.com/blog/ & http://twitter.com/openquery



References