SphinxQL 与 php mysqli/pdo 和准备好的语句
当通过 SphinxQL 查询 Sphinx 时,您会获得在 PHP 中使用 mysqli/pdo 的标准好处吗?
此外,在 SphinxQL 中使用准备好的语句有什么好处吗?他们甚至得到支持吗?
When querying Sphinx through SphinxQL would you gain the standard benefits of using mysqli/pdo in PHP?
In additions is there any benefit to using prepared statements with SphinxQL? Are they even supported?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
我认为不支持正确的二进制(即在协议-服务器端)准备好的语句。它必须是软件模拟的(客户端),这不会带来太多好处。
一般来说,准备语句的主要原因之一(除了 SQL 注入保护之外)是为了避免对每个命令进行完整 SQL 解析的开销。 sphinx 理解的 sql 方言比完整的数据库服务器简单得多,因此它通常比解析传入的语句要快得多。
我认为你也可以使用 mysqli,但 PDO 不会带来太多好处。
但最终,请使用您最熟悉的,而不是担心每个可能带来的微小好处:)
I don't think proper binary (ie in the protocol - server-side) prepared statements are supported. It would have to be software emulated (client-side), which wouldn't bring much benefit.
In general one of the main reasons (other than sql injection protection) for prepared statements, is to avoid the overhead of full SQL parsing on every command. the sql dialect understood by sphinx is much simpler than a full blown database server, so it should in general be much quicker that parsing the incoming statements.
You may as well use mysqli I would think, but PDO wouldnt bring much benefit.
But at the end of the day, use which is most familiar to you, rather than worrying about the tiny benefits each might bring :)