<tfoot id='osOzE'></tfoot>

    1. <small id='osOzE'></small><noframes id='osOzE'>

      <legend id='osOzE'><style id='osOzE'><dir id='osOzE'><q id='osOzE'></q></dir></style></legend>
      <i id='osOzE'><tr id='osOzE'><dt id='osOzE'><q id='osOzE'><span id='osOzE'><b id='osOzE'><form id='osOzE'><ins id='osOzE'></ins><ul id='osOzE'></ul><sub id='osOzE'></sub></form><legend id='osOzE'></legend><bdo id='osOzE'><pre id='osOzE'><center id='osOzE'></center></pre></bdo></b><th id='osOzE'></th></span></q></dt></tr></i><div id='osOzE'><tfoot id='osOzE'></tfoot><dl id='osOzE'><fieldset id='osOzE'></fieldset></dl></div>
      • <bdo id='osOzE'></bdo><ul id='osOzE'></ul>
      1. 让 Doctrine 使用 MySQL “FORCE INDEX"

        Getting Doctrine to use MySQL quot;FORCE INDEXquot;(让 Doctrine 使用 MySQL “FORCE INDEX)
          <tbody id='GS35e'></tbody>
        <i id='GS35e'><tr id='GS35e'><dt id='GS35e'><q id='GS35e'><span id='GS35e'><b id='GS35e'><form id='GS35e'><ins id='GS35e'></ins><ul id='GS35e'></ul><sub id='GS35e'></sub></form><legend id='GS35e'></legend><bdo id='GS35e'><pre id='GS35e'><center id='GS35e'></center></pre></bdo></b><th id='GS35e'></th></span></q></dt></tr></i><div id='GS35e'><tfoot id='GS35e'></tfoot><dl id='GS35e'><fieldset id='GS35e'></fieldset></dl></div>
          <bdo id='GS35e'></bdo><ul id='GS35e'></ul>
        • <tfoot id='GS35e'></tfoot>

                <legend id='GS35e'><style id='GS35e'><dir id='GS35e'><q id='GS35e'></q></dir></style></legend>

                  <small id='GS35e'></small><noframes id='GS35e'>

                  本文介绍了让 Doctrine 使用 MySQL “FORCE INDEX"的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着跟版网的小编来一起学习吧!

                  问题描述

                  我在 Doctrine 的 DQL 中有一个查询,需要能够使用 MySQL 的FORCE INDEX".功能,以大大减少查询时间.下面是查询在普通 SQL 中的基本样子:

                  I have a query in Doctrine's DQL that needs to be able to use MySQL's "FORCE INDEX" functionality in order to massively reduce the query time. Below is what the query basically looks like in plain SQL:

                  SELECT id FROM items FORCE INDEX (best_selling_idx)
                  WHERE price = ... (etc)
                  LIMIT 200;
                  

                  我假设我必须扩展一些 Doctrine 组件才能使用 DQL 执行此操作(或者有没有办法将任意 SQL 注入到 Doctrin 的查询之一中?).有人有什么想法吗?

                  I assume I have to extend some Doctrine component to be able to do this with DQL (or is there a way to inject arbitrary SQL into one of Doctrin's queries?). Anyone have any ideas?

                  推荐答案

                  我在网上找到了很少有帮助的 Doctrine_RawSql 示例,所以这就是我最终创建查询的方法.

                  I've found very few helpful Doctrine_RawSql examples online, so here's what I ended up doing to create my query.

                  $q = new Doctrine_RawSql();
                  $q->select('{b.id}, {b.description}, {c.description}')
                    ->from('table1 b FORCE INDEX(best_selling_idx) INNER JOIN table2 c ON b.c_id = c.id')
                    ->addComponent('b', 'Table1 b')
                    ->addComponent('c', 'b.Table2 c');
                  

                  这篇关于让 Doctrine 使用 MySQL “FORCE INDEX"的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持跟版网!

                  本站部分内容来源互联网,如果有图片或者内容侵犯了您的权益,请联系我们,我们会在确认后第一时间进行删除!

                  相关文档推荐

                  DeepL的翻译效果还是很强大的,如果我们要用php实现DeepL翻译调用,该怎么办呢?以下是代码示例,希望能够帮到需要的朋友。 在这里需要注意,这个DeepL的账户和api申请比较难,不支持中国大陆申请,需要拥有香港或者海外信用卡才行,没账号的话,目前某宝可以
                  PHP通过phpspreadsheet导入Excel日期,导入系统后,全部变为了4开头的几位数字,这是为什么呢?原因很简单,将Excel的时间设置问文本,我们就能看到该日期本来的数值,上图对应的数值为: 要怎么解决呢?进行数据转换就行,这里可以封装方法,或者用第三方的
                  mediatemple - can#39;t send email using codeigniter(mediatemple - 无法使用 codeigniter 发送电子邮件)
                  Laravel Gmail Configuration Error(Laravel Gmail 配置错误)
                  Problem with using PHPMailer for SMTP(将 PHPMailer 用于 SMTP 的问题)
                  Issue on how to setup SMTP using PHPMailer in GoDaddy server(关于如何在 GoDaddy 服务器中使用 PHPMailer 设置 SMTP 的问题)
                • <legend id='2rSEs'><style id='2rSEs'><dir id='2rSEs'><q id='2rSEs'></q></dir></style></legend>
                    <bdo id='2rSEs'></bdo><ul id='2rSEs'></ul>
                    <tfoot id='2rSEs'></tfoot>

                      • <i id='2rSEs'><tr id='2rSEs'><dt id='2rSEs'><q id='2rSEs'><span id='2rSEs'><b id='2rSEs'><form id='2rSEs'><ins id='2rSEs'></ins><ul id='2rSEs'></ul><sub id='2rSEs'></sub></form><legend id='2rSEs'></legend><bdo id='2rSEs'><pre id='2rSEs'><center id='2rSEs'></center></pre></bdo></b><th id='2rSEs'></th></span></q></dt></tr></i><div id='2rSEs'><tfoot id='2rSEs'></tfoot><dl id='2rSEs'><fieldset id='2rSEs'></fieldset></dl></div>
                            <tbody id='2rSEs'></tbody>

                          <small id='2rSEs'></small><noframes id='2rSEs'>