mwild1 / luadbi

Multi-backend SQL database library for Lua
MIT License
42 stars 15 forks source link

Oracle bugfixes and improvements #45

Closed JorjBauer closed 6 years ago

JorjBauer commented 6 years ago

Removed unused vars; fixed copypasta constant from POSTGRESQL code. Performance improved roughly two orders of magnitude for fairly arbitrary multi-row tests by turning on a 1MB prefetch cache. See comment in 411b774 about TO_CHAR conversion size and truncation...

sparked435 commented 6 years ago

This looks good to me.

Unfortunately, I can only assume this works, as I don't have access to a working Oracle database to even compile test it. I'm going to assume that you've proven it working in whatever environment you are using, and will send another pull request if you find any other problems. :)

JorjBauer commented 6 years ago

Assumptions valid! :)

Tested on RHEL 7 / Lua 5.1.4 / Oracle 12. I'll see about testing with other configurations if time permits.

I would like to expose some better cache control, but there doesn't seem to be any framework for meta-configuration. (Perl DBD::Oracle does this messily; presetting $sth->{RowCacheSize} and calling prepare with an options hashref like {ora_prefetch_memory=>10000}. Yuck.)

Combined with the result size problem (411b774), there's opportunity for better handling. I don't know what it is yet, but when it bites me, I'll send another pull request.