You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@lucene.apache.org by "Chris Book (JIRA)" <ji...@apache.org> on 2010/07/06 05:50:50 UTC

[jira] Commented: (SOLR-1262) DIH needs support for callable statements

    [ https://issues.apache.org/jira/browse/SOLR-1262?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12885407#action_12885407 ] 

Chris Book commented on SOLR-1262:
----------------------------------

I think the original comment about prepared statements is more valid.  For a one-to-many, dataimporthandler is generating the same query many times with just a different key param.  A prepared statement allows the db server (ie mysql) to keep the query alive and just return different results per key each time.  You save on the overhead of the db parsing the query and other setup.

I agree that callable statements move the logic into sql which is not ideal.  Using prepared statements by default should require no change to the xml schema.

> DIH needs support for callable statements 
> ------------------------------------------
>
>                 Key: SOLR-1262
>                 URL: https://issues.apache.org/jira/browse/SOLR-1262
>             Project: Solr
>          Issue Type: Improvement
>          Components: contrib - DataImportHandler
>    Affects Versions: 1.3
>         Environment: linux
> mysql
>            Reporter: Abdul Chaudhry
>            Assignee: Noble Paul
>            Priority: Minor
>             Fix For: Next
>
>
> During an indexing run we noticed that we were spending a lot of time creating and tearing down queries in mysql
> The queries we are using are complex and involve joins spanning across multiple tables.
> We should support prepared statements in the data import handler via the data-config.xml file - for those databases that support prepared statements.
> We could add a new attribute to the entity entity in dataConfig - say - pquery or preparedQuery and then pass the prepared statement and have values filled in by the actual queries for each row using a placeholder - like a ? or something else.
> I would probably start by hacking class JdbcDataSource to try a test but was wondering if anyone had experienced this or had any suggestions or if there is something in the works that I missed - I couldn't find any other bugs mentioning using prepared statements for performance.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@lucene.apache.org
For additional commands, e-mail: dev-help@lucene.apache.org